From 6fc6f8d30009ad1a1c4877858e064f605573b51b Mon Sep 17 00:00:00 2001 From: lucy Date: Sun, 8 Mar 2026 14:20:18 +0100 Subject: [PATCH] add ipc to reload colors --- ThemeLoader.qml | 6 ++++++ modules/ipc/Ipc.qml | 10 ++++++++++ shell.qml | 2 ++ 3 files changed, 18 insertions(+) create mode 100644 modules/ipc/Ipc.qml diff --git a/ThemeLoader.qml b/ThemeLoader.qml index 1debbab..cfc79a7 100644 --- a/ThemeLoader.qml +++ b/ThemeLoader.qml @@ -6,9 +6,15 @@ import Quickshell.Io Singleton { id: root property alias colors: loader + function reload() { + loader.reload(); + } FileView { id: loader + watchChanges: true + onFileChanged: this.reload() + onAdapterUpdated: this.reload() // create color properties, initialize them to black and helper color array property var colors: text().split('\n') diff --git a/modules/ipc/Ipc.qml b/modules/ipc/Ipc.qml new file mode 100644 index 0000000..85e9f6a --- /dev/null +++ b/modules/ipc/Ipc.qml @@ -0,0 +1,10 @@ +import Quickshell +import Quickshell.Io +import qs + +IpcHandler { + target: "colors" +function reload() { + ThemeLoader.reload() +} +} diff --git a/shell.qml b/shell.qml index 4efaf44..639684a 100644 --- a/shell.qml +++ b/shell.qml @@ -1,8 +1,10 @@ import Quickshell import QtQuick import qs.modules.Bar +import qs.modules.ipc ShellRoot { id: root Bar {} + Ipc {} }