diff options
| author | Danilo M. <danix@danix.xyz> | 2026-10-07 18:57:23 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-10-07 18:57:23 +0200 |
| commit | b324ff0fb5cbc13a038ce2e5a2a4af69598bb91a (patch) | |
| tree | 3038d7ed7f940b209b7e9db68393c6e229d925cd | |
| parent | 744802e1ecb44ddb4714f8922b8ee0e9e5def811 (diff) | |
| download | quickshell-b324ff0fb5cbc13a038ce2e5a2a4af69598bb91a.tar.gz quickshell-b324ff0fb5cbc13a038ce2e5a2a4af69598bb91a.zip | |
fix(island): review findings in the pill components
- The flag switches once per wheel notch; a touchpad's stream of small
deltas switched an erratic number of times.
- The flick decides on resolved icon paths, so a name the icon theme lacks
falls back to the workspace number instead of a blank slot.
- Layout switching uses Hyprland's 'current' keyboard rather than looking
up the main device in a subshell.
- The capsule radius reaches half the rest height, a real capsule.
- privacy.sh exits non-zero when pw-dump fails, so Privacy keeps its last
reading instead of reporting nothing captured.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| -rw-r--r-- | desktop/island/Capsule.qml | 2 | ||||
| -rw-r--r-- | desktop/island/ClockPill.qml | 17 | ||||
| -rw-r--r-- | desktop/island/Keyboard.qml | 7 | ||||
| -rw-r--r-- | desktop/island/StatusPill.qml | 10 | ||||
| -rwxr-xr-x | desktop/island/privacy.sh | 4 |
5 files changed, 26 insertions, 14 deletions
diff --git a/desktop/island/Capsule.qml b/desktop/island/Capsule.qml index 76329e0..65c98d9 100644 --- a/desktop/island/Capsule.qml +++ b/desktop/island/Capsule.qml @@ -39,7 +39,7 @@ Rectangle { SmoothedAnimation { velocity: -1; duration: 220; reversingMode: SmoothedAnimation.Immediate } } - radius: Math.min(14, width / 2, height / 2) + radius: Math.min(17, width / 2, height / 2) color: Qt.alpha(Theme.base, 0.92) border.width: 1 border.color: Qt.alpha(Theme.text, 0.12) diff --git a/desktop/island/ClockPill.qml b/desktop/island/ClockPill.qml index f1217f1..07a0eb7 100644 --- a/desktop/island/ClockPill.qml +++ b/desktop/island/ClockPill.qml @@ -27,6 +27,12 @@ Capsule { readonly property var entry: flickApp ? DesktopEntries.heuristicLookup(flickApp) : null readonly property string wsIcon: Workspaces.icon(flickWs) + // Resolved paths, not names, decide what shows: a name the icon theme + // lacks resolves to "", and testing the name left a blank slot where the + // workspace number should have been. + readonly property string wsPath: wsIcon ? Quickshell.iconPath(wsIcon, true) : "" + readonly property string appPath: + flickApp ? Quickshell.iconPath(entry?.icon || flickApp, true) : "" restWidth: (flicking ? flickRow.implicitWidth : restRow.implicitWidth) + 28 @@ -73,24 +79,23 @@ Capsule { IconImage { anchors.verticalCenter: parent.verticalCenter - visible: pill.wsIcon !== "" + visible: pill.wsPath !== "" implicitSize: 18 - source: pill.wsIcon ? Quickshell.iconPath(pill.wsIcon, true) : "" + source: pill.wsPath } // A named workspace, or one past eight, has no icon: its number. Text { anchors.verticalCenter: parent.verticalCenter - visible: pill.wsIcon === "" + visible: pill.wsPath === "" text: pill.flickWs font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 1; weight: Font.DemiBold } color: Theme.accent } IconImage { anchors.verticalCenter: parent.verticalCenter - visible: pill.flickApp !== "" + visible: pill.appPath !== "" implicitSize: 18 - source: pill.flickApp - ? Quickshell.iconPath(pill.entry?.icon || pill.flickApp, true) : "" + source: pill.appPath } Text { anchors.verticalCenter: parent.verticalCenter diff --git a/desktop/island/Keyboard.qml b/desktop/island/Keyboard.qml index 1cbe9bc..0cd73c8 100644 --- a/desktop/island/Keyboard.qml +++ b/desktop/island/Keyboard.qml @@ -26,9 +26,6 @@ Singleton { property string keymap: "" readonly property string flag: Logic.flagFor(keymap) - readonly property string mainKeyboard: - "hyprctl devices -j | jq -r '.keyboards[] | select(.main) | .name'" - Process { id: query running: true @@ -46,8 +43,8 @@ Singleton { // dir is "next" or "prev", from the caller's own literal, never user text. function cycle(dir) { - switcher.command = ["sh", "-c", - `hyprctl switchxkblayout "$(${root.mainKeyboard})" ${dir}`]; + // "current" is Hyprland's own name for the main keyboard. + switcher.command = ["hyprctl", "switchxkblayout", "current", dir]; switcher.running = false; switcher.running = true; } diff --git a/desktop/island/StatusPill.qml b/desktop/island/StatusPill.qml index faf24dd..ab62da8 100644 --- a/desktop/island/StatusPill.qml +++ b/desktop/island/StatusPill.qml @@ -88,8 +88,16 @@ Capsule { sourceSize: Qt.size(18, 18) source: Qt.resolvedUrl("assets/" + Keyboard.flag) + // One switch per wheel notch (120). A touchpad sends many small + // deltas, and switching on each made the count erratic. WheelHandler { - onWheel: event => Keyboard.cycle(event.angleDelta.y > 0 ? "prev" : "next") + property real acc: 0 + onWheel: event => { + acc += event.angleDelta.y; + if (Math.abs(acc) < 120) return; + Keyboard.cycle(acc > 0 ? "prev" : "next"); + acc = 0; + } } } } diff --git a/desktop/island/privacy.sh b/desktop/island/privacy.sh index 9d5b360..8e70933 100755 --- a/desktop/island/privacy.sh +++ b/desktop/island/privacy.sh @@ -16,7 +16,9 @@ # pw-dump because a capturing source is told from an idle one by its node # state, which Quickshell's PwNode does not expose. -dump=$(pw-dump 2>/dev/null) +# No dump is a broken run, not "nothing is capturing": print nothing, and +# Privacy.qml keeps its last reading. +dump=$(pw-dump 2>/dev/null) || exit 1 mic=$(printf '%s' "$dump" | jq '[.[] | select(.type == "PipeWire:Interface:Node") |
