config: added option to set session icons (#1189)

This commit is contained in:
八奈見 レイ 2026-02-19 17:30:02 +05:30 committed by GitHub
parent 46174d1934
commit 1313b899ad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 24 additions and 4 deletions

View file

@ -604,6 +604,12 @@ default, you must create it manually.
"dragThreshold": 30,
"enabled": true,
"vimKeybinds": false,
"icons": {
"logout": "logout",
"shutdown": "power_settings_new",
"hibernate": "downloading",
"reboot": "cached"
},
"commands": {
"logout": ["loginctl", "terminate-user", ""],
"shutdown": ["systemctl", "poweroff"],

View file

@ -359,6 +359,12 @@ Singleton {
enabled: session.enabled,
dragThreshold: session.dragThreshold,
vimKeybinds: session.vimKeybinds,
icons: {
logout: session.icons.logout,
shutdown: session.icons.shutdown,
hibernate: session.icons.hibernate,
reboot: session.icons.reboot
},
commands: {
logout: session.commands.logout,
shutdown: session.commands.shutdown,

View file

@ -4,10 +4,18 @@ JsonObject {
property bool enabled: true
property int dragThreshold: 30
property bool vimKeybinds: false
property Icons icons: Icons {}
property Commands commands: Commands {}
property Sizes sizes: Sizes {}
component Icons: JsonObject {
property string logout: "logout"
property string shutdown: "power_settings_new"
property string hibernate: "downloading"
property string reboot: "cached"
}
component Commands: JsonObject {
property list<string> logout: ["loginctl", "terminate-user", ""]
property list<string> shutdown: ["systemctl", "poweroff"]

View file

@ -18,7 +18,7 @@ Column {
SessionButton {
id: logout
icon: "logout"
icon: Config.session.icons.logout
command: Config.session.commands.logout
KeyNavigation.down: shutdown
@ -38,7 +38,7 @@ Column {
SessionButton {
id: shutdown
icon: "power_settings_new"
icon: Config.session.icons.shutdown
command: Config.session.commands.shutdown
KeyNavigation.up: logout
@ -60,7 +60,7 @@ Column {
SessionButton {
id: hibernate
icon: "downloading"
icon: Config.session.icons.hibernate
command: Config.session.commands.hibernate
KeyNavigation.up: shutdown
@ -70,7 +70,7 @@ Column {
SessionButton {
id: reboot
icon: "cached"
icon: Config.session.icons.reboot
command: Config.session.commands.reboot
KeyNavigation.up: hibernate