powermenu config in shell json

This commit is contained in:
Benjamin Palko 2025-09-23 15:06:23 -04:00
parent 7935487295
commit 7ba6222105
2 changed files with 25 additions and 19 deletions

View file

@ -1,9 +1,33 @@
pragma Singleton pragma Singleton
import Quickshell import Quickshell
import Quickshell.Io
Singleton { Singleton {
id: root id: root
readonly property PowerMenu powermenu: PowerMenu {} readonly property alias powermenu: adapter.powermenu
FileView {
path: `${Paths.config}/shell.json`
watchChanges: true
onFileChanged: reload()
// onAdapterUpdated: writeAdapter()
JsonAdapter {
id: adapter
property var powermenu: PowerMenu {}
}
}
component PowerMenu: JsonObject {
property list<PowerMenuItem> actions
}
component PowerMenuItem: JsonObject {
property string text
property string command
}
} }

View file

@ -1,18 +0,0 @@
import Quickshell
PersistentProperties {
property list<var> actions: [
{
text: "󰍃 Logout",
command: "hyprctl dispatch exit"
},
{
text: "󰜉 Reboot",
command: "systemctl reboot"
},
{
text: " Shutdown",
command: "systemctl poweroff"
}
]
}