summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcaley <195605706+cqley@users.noreply.github.com>2026-07-24 18:19:12 +0200
committerGitHub <noreply@github.com>2026-07-24 18:19:12 +0200
commit27dc9db508ac10e766963e1b0f2f9ef3c52a1d81 (patch)
tree06bd4eeaa3aadc41652433dccef5d915171b8483
parent8a23bdae3c4574a109955e34ab4d30a67773985b (diff)
Update qksh.nix
-rw-r--r--nixos/hosts/bed/components/qksh.nix43
1 files changed, 39 insertions, 4 deletions
diff --git a/nixos/hosts/bed/components/qksh.nix b/nixos/hosts/bed/components/qksh.nix
index 55d84dd..280da6d 100644
--- a/nixos/hosts/bed/components/qksh.nix
+++ b/nixos/hosts/bed/components/qksh.nix
@@ -66,7 +66,7 @@
property string layout: barSettings.layout
property string look: barSettings.look
- screen: Quickshell.screens.find(s => s.name === "HDMI-A-1") ?? Quickshell.screens[0]
+ screen: Quickshell.screens[0]
property string activeMode: "none"
property bool autoHideBar: false
@@ -75,6 +75,7 @@
property string sysStats: "cpu --% | mem --%"
property string micState: "󰍬"
+ property string batState: "--%"
function removeNotif(nid) {
for (let i = 0; i < notifModel.count; i++) {
@@ -408,6 +409,7 @@
onTriggered: {
if (barSettings.centerMode === "performance" && !sysProc.running) sysProc.running = true
if (!micProc.running) micProc.running = true
+ if (!batProc.running) batProc.running = true
}
}
@@ -430,6 +432,15 @@
}
Process {
+ id: batProc
+ command: ["sh", "-c", "b=$(cat /sys/class/power_supply/BAT*/capacity 2>/dev/null | head -n1); echo \"''${b:-0}%\""]
+ running: false
+ stdout: SplitParser {
+ onRead: data => { root.batState = data.trim() }
+ }
+ }
+
+ Process {
id: micActProc
running: false
onRunningChanged: if (!running) micProc.running = true
@@ -596,6 +607,30 @@
Item {
Layout.fillHeight: true
+ implicitWidth: 36
+
+ Row {
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.right: parent.right
+ anchors.rightMargin: 6
+ spacing: 2
+
+ Item {
+ width: 28
+ height: 22
+
+ MText {
+ id: batText
+ anchors.centerIn: parent
+ text: root.batState
+ color: configRoot.colors.special.foreground
+ }
+ }
+ }
+ }
+
+ Item {
+ Layout.fillHeight: true
implicitWidth: clockText.implicitWidth + 20
Rectangle {
@@ -631,7 +666,7 @@
id: masterOverlay
visible: root.activeMode === "master" && root.masterFiltered.length > 0
- screen: Quickshell.screens.find(s => s.name === "HDMI-A-1") ?? Quickshell.screens[0]
+ screen: Quickshell.screens[0]
anchors.top: root.position === "top"
anchors.bottom: root.position === "bottom"
@@ -723,7 +758,7 @@
id: notifOverlay
visible: notifModel.count > 0
- screen: Quickshell.screens.find(s => s.name === "HDMI-A-1") ?? Quickshell.screens[0]
+ screen: Quickshell.screens[0]
anchors.top: root.position === "top"
anchors.bottom: root.position === "bottom"
@@ -815,7 +850,7 @@
id: calendarOverlay
visible: root.activeMode === "calendar"
- screen: Quickshell.screens.find(s => s.name === "HDMI-A-1") ?? Quickshell.screens[0]
+ screen: Quickshell.screens[0]
anchors.top: root.position === "top"
anchors.bottom: root.position === "bottom"