diff options
| author | caley <195605706+cqley@users.noreply.github.com> | 2026-07-30 16:33:48 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-07-30 16:33:48 +0200 |
| commit | 469140b90dbdce8c399232b3cbdaed5cecc6505a (patch) | |
| tree | 8131d4632196c1acc1b1afbeb0a5d535abe6ac0d /nixos/hosts/box/components | |
| parent | a2897908b4806f654bc20f3ea80c2ae829bc13e6 (diff) | |
Update qksh.nix
Diffstat (limited to 'nixos/hosts/box/components')
| -rw-r--r-- | nixos/hosts/box/components/qksh.nix | 67 |
1 files changed, 53 insertions, 14 deletions
diff --git a/nixos/hosts/box/components/qksh.nix b/nixos/hosts/box/components/qksh.nix index 347dcb7..f2bd8a1 100644 --- a/nixos/hosts/box/components/qksh.nix +++ b/nixos/hosts/box/components/qksh.nix @@ -316,13 +316,13 @@ } onActiveModeChanged: { - if (activeMode !== "none" && activeMode !== "calendar" && activeMode !== "wifi" && typeof barInput !== "undefined") { + if (activeMode !== "none" && activeMode !== "calendar" && activeMode !== "wifi" && activeMode !== "tray" && typeof barInput !== "undefined") { barInput.text = "" barInput.forceActiveFocus() } } - WlrLayershell.keyboardFocus: activeMode !== "none" && activeMode !== "calendar" && activeMode !== "wifi" ? WlrLayershell.Exclusive : WlrLayershell.None + WlrLayershell.keyboardFocus: activeMode !== "none" && activeMode !== "calendar" && activeMode !== "wifi" && activeMode !== "tray" ? WlrLayershell.Exclusive : WlrLayershell.None anchors.top: position === "top" anchors.bottom: position === "bottom" @@ -371,6 +371,13 @@ } } IpcHandler { + target: "tray" + function toggle(): void { + if (root.activeMode === "tray") root.activeMode = "none" + else root.activeMode = "tray" + } + } + IpcHandler { target: "mic" function toggle(): void { micActProc.command = ["${pkgs.wireplumber}/bin/wpctl", "set-mute", "@DEFAULT_AUDIO_SOURCE@", "toggle"] @@ -588,7 +595,7 @@ MText { anchors.centerIn: parent - visible: root.activeMode === "none" || root.activeMode === "calendar" || root.activeMode === "wifi" + visible: root.activeMode === "none" || root.activeMode === "calendar" || root.activeMode === "wifi" || root.activeMode === "tray" text: barSettings.centerMode === "performance" ? root.sysStats : "" color: configRoot.colors.special.foreground } @@ -716,17 +723,16 @@ height: 22 MText { - id: micText anchors.centerIn: parent - text: root.micState + text: "" color: configRoot.colors.special.foreground } MouseArea { anchors.fill: parent onClicked: { - micActProc.command = ["${pkgs.wireplumber}/bin/wpctl", "set-mute", "@DEFAULT_AUDIO_SOURCE@", "toggle"] - micActProc.running = true + if (root.activeMode === "tray") root.activeMode = "none" + else root.activeMode = "tray" } } } @@ -746,19 +752,17 @@ height: 22 MText { - id: wifiText + id: micText anchors.centerIn: parent - text: root.wifiState - color: root.wifiConnecting ? configRoot.colors.colors.color3 - : root.wifiConnectedSSID !== "" ? configRoot.colors.colors.color2 - : configRoot.colors.special.foreground + text: root.micState + color: configRoot.colors.special.foreground } MouseArea { anchors.fill: parent onClicked: { - if (root.activeMode === "wifi") root.activeMode = "none" - else root.wifiOpen() + micActProc.command = ["${pkgs.wireplumber}/bin/wpctl", "set-mute", "@DEFAULT_AUDIO_SOURCE@", "toggle"] + micActProc.running = true } } } @@ -980,6 +984,41 @@ } OverlayPanel { + id: trayOverlay + visible: root.activeMode === "tray" + keyboardExclusive: false + + implicitWidth: trayRow.implicitWidth + 24 + implicitHeight: 34 + + Rectangle { + anchors.fill: parent + color: configRoot.colors.special.background + border.color: configRoot.colors.colors.color8 + border.width: 1 + + Row { + id: trayRow + anchors.centerIn: parent + spacing: 8 + MText { + text: root.wifiState + color: root.wifiConnecting ? configRoot.colors.colors.color3 : (root.wifiConnectedSSID !== "" ? configRoot.colors.colors.color2 : configRoot.colors.special.foreground) + } + MText { + text: root.wifiConnecting ? "connecting..." : (root.wifiConnectedSSID !== "" ? root.wifiConnectedSSID : "disconnected") + color: configRoot.colors.special.foreground + } + } + MouseArea { + anchors.fill: parent + hoverEnabled: true + onClicked: root.wifiOpen() + } + } + } + + OverlayPanel { id: wifiOverlay visible: root.activeMode === "wifi" keyboardExclusive: true |
