diff options
Diffstat (limited to 'modules/Shortcuts.qml')
| -rw-r--r-- | modules/Shortcuts.qml | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/modules/Shortcuts.qml b/modules/Shortcuts.qml index f6cc9e3..bed620c 100644 --- a/modules/Shortcuts.qml +++ b/modules/Shortcuts.qml @@ -1,6 +1,7 @@ import "root:/widgets" import "root:/services" import Quickshell +import Quickshell.Io Scope { id: root @@ -34,4 +35,22 @@ Scope { description: "Interrupt launcher keybind" onPressed: root.launcherInterrupted = true } + + IpcHandler { + target: "drawers" + + function toggle(drawer: string): void { + if (list().split("\n").includes(drawer)) { + const visibilities = Visibilities.getForActive(); + visibilities[drawer] = !visibilities[drawer]; + } else { + console.warn(`[IPC] Drawer "${drawer}" does not exist`); + } + } + + function list(): string { + const visibilities = Visibilities.getForActive(); + return Object.keys(visibilities).filter(k => typeof visibilities[k] === "boolean").join("\n"); + } + } } |