From 7ba62221053b7ea9ee56d5ca80abcb3ae795b736 Mon Sep 17 00:00:00 2001 From: Benjamin Palko Date: Tue, 23 Sep 2025 15:06:23 -0400 Subject: [PATCH] powermenu config in shell json --- config/Config.qml | 26 +++++++++++++++++++++++++- config/PowerMenu.qml | 18 ------------------ 2 files changed, 25 insertions(+), 19 deletions(-) delete mode 100644 config/PowerMenu.qml diff --git a/config/Config.qml b/config/Config.qml index 2cd8ea0..036f14c 100644 --- a/config/Config.qml +++ b/config/Config.qml @@ -1,9 +1,33 @@ pragma Singleton import Quickshell +import Quickshell.Io Singleton { 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 actions + } + + component PowerMenuItem: JsonObject { + property string text + property string command + } } diff --git a/config/PowerMenu.qml b/config/PowerMenu.qml deleted file mode 100644 index 0046bd9..0000000 --- a/config/PowerMenu.qml +++ /dev/null @@ -1,18 +0,0 @@ -import Quickshell - -PersistentProperties { - property list actions: [ - { - text: "󰍃 Logout", - command: "hyprctl dispatch exit" - }, - { - text: "󰜉 Reboot", - command: "systemctl reboot" - }, - { - text: " Shutdown", - command: "systemctl poweroff" - } - ] -}