powermenu config in shell json
This commit is contained in:
parent
7935487295
commit
7ba6222105
2 changed files with 25 additions and 19 deletions
|
|
@ -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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
Loading…
Add table
Reference in a new issue