diff options
Diffstat (limited to '.config/quickshell/Services')
| -rw-r--r-- | .config/quickshell/Services/Uptime.qml | 8 | ||||
| -rw-r--r-- | .config/quickshell/Services/Wifi.qml | 4 |
2 files changed, 9 insertions, 3 deletions
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] |
