From 3d300067f6e179e03d1983159b81e1c2cfe2fa8c Mon Sep 17 00:00:00 2001 From: Sam Nystrom Date: Fri, 16 Jan 2026 11:04:25 -0500 Subject: refactor qs bar --- .config/quickshell/Services/Uptime.qml | 8 +++++--- .config/quickshell/Services/Wifi.qml | 4 ++++ 2 files changed, 9 insertions(+), 3 deletions(-) (limited to '.config/quickshell/Services') diff --git a/.config/quickshell/Services/Uptime.qml b/.config/quickshell/Services/Uptime.qml index 155be44..b406921 100644 --- a/.config/quickshell/Services/Uptime.qml +++ b/.config/quickshell/Services/Uptime.qml @@ -44,10 +44,12 @@ Singleton { if (hours > 0) { uptime += hours + " hour" if (hours != 1) uptime += "s" - uptime += ", " + if (days == 0) uptime += ", " + } + if (days == 0) { + uptime += minutes + " minute" + if (minutes != 1) uptime += "s" } - uptime += minutes + " minute" - if (minutes != 1) uptime += "s" root.uptime = uptime } diff --git a/.config/quickshell/Services/Wifi.qml b/.config/quickshell/Services/Wifi.qml index c8fd54b..b116879 100644 --- a/.config/quickshell/Services/Wifi.qml +++ b/.config/quickshell/Services/Wifi.qml @@ -15,6 +15,10 @@ Singleton { stdout: StdioCollector { onStreamFinished: { var line = this.text.split("\n").find(line => line.includes(">")) + if (!line) { + root.ssid = "" + return + } // remove ANSI escape sequences line = line.replace(/\x1b\[.*?[@A-Z\[\\\]^_`a-z\{\|\}~]/g, '') root.ssid = line.split(" ").filter(x => x != "")[1] -- cgit v1.2.3