From 9bc49c3ee4d6f0f05c7356403b94cf690d3ddfdb Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sun, 15 Mar 2026 14:48:03 +0100 Subject: ... --- accounts/gkleen@sif/shell/quickshell/BatteryWidget.qml | 5 ++++- accounts/gkleen@sif/shell/quickshell/Services/Brightness.qml | 4 +++- accounts/gkleen@sif/shell/quickshell/VolumeOSD.qml | 4 ++-- accounts/gkleen@sif/shell/quickshell/WorkspaceSwitcher.qml | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/accounts/gkleen@sif/shell/quickshell/BatteryWidget.qml b/accounts/gkleen@sif/shell/quickshell/BatteryWidget.qml index da17df2a..f465fa20 100644 --- a/accounts/gkleen@sif/shell/quickshell/BatteryWidget.qml +++ b/accounts/gkleen@sif/shell/quickshell/BatteryWidget.qml @@ -102,9 +102,12 @@ Item { color: "white" text: { + if (!root.batteryDevice?.ready) + return "Not ready"; + const stateStr = UPowerDeviceState.toString(root.batteryDevice.state); var outStr = stateStr; - if (root.batteryDevice.state != UPowerDeviceState.FullyCharged) + if (root.batteryDevice.state !== UPowerDeviceState.FullyCharged) outStr += ` ${Math.round(root.batteryDevice.percentage * 100)}%`; function formatTime(t) { diff --git a/accounts/gkleen@sif/shell/quickshell/Services/Brightness.qml b/accounts/gkleen@sif/shell/quickshell/Services/Brightness.qml index c01169cd..f3ae6804 100644 --- a/accounts/gkleen@sif/shell/quickshell/Services/Brightness.qml +++ b/accounts/gkleen@sif/shell/quickshell/Services/Brightness.qml @@ -84,7 +84,9 @@ Singleton { property bool onlyInternal: true Connections { target: NiriService - onOutputsChanged: root.onlyInternal = Object.keys(NiriService.outputs).every(oname => oname == "eDP-1") + function onOutputsChanged() { + root.onlyInternal = Object.keys(NiriService.outputs).every(oname => oname == "eDP-1"); + } } onOnlyInternalChanged: { if (startupDelay.running) diff --git a/accounts/gkleen@sif/shell/quickshell/VolumeOSD.qml b/accounts/gkleen@sif/shell/quickshell/VolumeOSD.qml index 653f4763..91dc9591 100644 --- a/accounts/gkleen@sif/shell/quickshell/VolumeOSD.qml +++ b/accounts/gkleen@sif/shell/quickshell/VolumeOSD.qml @@ -16,7 +16,7 @@ Scope { Connections { enabled: Pipewire.defaultAudioSink - target: Pipewire.defaultAudioSink?.audio + target: Pipewire.defaultAudioSink?.audio || null function onVolumeChanged() { root.show = "sink"; @@ -30,7 +30,7 @@ Scope { Connections { enabled: Pipewire.defaultAudioSource - target: Pipewire.defaultAudioSource?.audio + target: Pipewire.defaultAudioSource?.audio || null function onVolumeChanged() { root.show = "source"; diff --git a/accounts/gkleen@sif/shell/quickshell/WorkspaceSwitcher.qml b/accounts/gkleen@sif/shell/quickshell/WorkspaceSwitcher.qml index 0dd1bca8..d0595b3d 100644 --- a/accounts/gkleen@sif/shell/quickshell/WorkspaceSwitcher.qml +++ b/accounts/gkleen@sif/shell/quickshell/WorkspaceSwitcher.qml @@ -140,7 +140,7 @@ Row { if (a.layout.pos_in_scrolling_layout?.[1] !== b.layout.pos_in_scrolling_layout?.[1]) return a.layout.pos_in_scrolling_layout?.[1] - b.layout.pos_in_scrolling_layout?.[1] if (a.app_id !== b.app_id) - return a.app_id.localeCompare(b.app_id); + return a.app_id?.localeCompare(b.app_id); return a.title.localeCompare(b.title); }); -- cgit v1.2.3