From fe64dd1deaec7f9cd9001c002a3472a6619f4a82 Mon Sep 17 00:00:00 2001 From: purian23 Date: Thu, 25 Sep 2025 14:23:45 -0400 Subject: [PATCH] Add IPC for Control Center --- README.md | 4 ++++ docs/IPC.md | 15 +++++++++++++++ shell.qml | 31 +++++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+) diff --git a/README.md b/README.md index 3a435e97..2f83c9ae 100644 --- a/README.md +++ b/README.md @@ -310,6 +310,9 @@ binds { Mod+X hotkey-overlay-title="Power Menu" { spawn "dms" "ipc" "call" "powermenu" "toggle"; } + Mod+C hotkey-overlay-title="Control Center" { + spawn "dms" "ipc" "call" "control-center" "toggle"; + } XF86AudioRaiseVolume allow-when-locked=true { spawn "dms" "ipc" "call" "audio" "increment" "3"; } @@ -366,6 +369,7 @@ bind = SUPER, comma, exec, dms ipc call settings toggle bind = SUPER, P, exec, dms ipc call notepad toggle bind = SUPERALT, L, exec, dms ipc call lock lock bind = SUPER, X, exec, dms ipc call powermenu toggle +bind = SUPER, C, exec, dms ipc call control-center toggle # Audio controls (function keys) bindl = , XF86AudioRaiseVolume, exec, dms ipc call audio increment 3 diff --git a/docs/IPC.md b/docs/IPC.md index 301dc366..dc58430e 100644 --- a/docs/IPC.md +++ b/docs/IPC.md @@ -459,6 +459,21 @@ Power menu modal control for system power actions. - `close` - Hide power menu modal - `toggle` - Toggle power menu modal visibility +### Target: `control-center` +Control Center popout containing network, bluetooth, audio, power, and other quick settings. + +**Functions:** +- `open` - Show the control center +- `close` - Hide the control center +- `toggle` - Toggle control center visibility + +**Examples** +```bash +dms ipc call control-center toggle +dms ipc call control-center open +dms ipc call control-center close +``` + ### Target: `notepad` Notepad/scratchpad modal control for quick note-taking. diff --git a/shell.qml b/shell.qml index d5cedcad..5c2141f3 100644 --- a/shell.qml +++ b/shell.qml @@ -408,6 +408,37 @@ ShellRoot { target: "processlist" } + IpcHandler { + function open(): string { + controlCenterLoader.active = true + if (controlCenterLoader.item) { + // If already open just ensure visibility + controlCenterLoader.item.shouldBeVisible = true + return "CONTROL_CENTER_OPEN_SUCCESS" + } + return "CONTROL_CENTER_OPEN_FAILED" + } + + function close(): string { + if (controlCenterLoader.item) { + controlCenterLoader.item.shouldBeVisible = false + return "CONTROL_CENTER_CLOSE_SUCCESS" + } + return "CONTROL_CENTER_CLOSE_FAILED" + } + + function toggle(): string { + controlCenterLoader.active = true + if (controlCenterLoader.item) { + controlCenterLoader.item.shouldBeVisible = !controlCenterLoader.item.shouldBeVisible + return "CONTROL_CENTER_TOGGLE_SUCCESS" + } + return "CONTROL_CENTER_TOGGLE_FAILED" + } + + target: "control-center" + } + IpcHandler { function open(tab: string): string { dankDashPopoutLoader.active = true