1 +#
Quickshell Phase 2B Service/API Inventory — 2026-06-17 3 +Purpose: freeze the local API/runtime facts for Phase 2B bar status widgets before writing implementation code.
7 +- [`2026-06-17-quickshell-hypr-companion-baseline.md`](2026-06-17-quickshell-hypr-companion-baseline.md)
8 +- [`2026-06-17-quickshell-parity-checklist.md`](2026-06-17-quickshell-parity-checklist.md)
9 +- [`../plans/2026-06-17-quickshell-hypr-companions-phase-2a-bar-shell.md`](../plans/2026-06-17-quickshell-hypr-companions-phase-2a-bar-shell.md)
11 +##
Local runtime snapshot 13 +Commands run on the live system, non-mutating:
16 +wpctl get-volume @DEFAULT_AUDIO_SINK@
18 +upower -i /org/freedesktop/UPower/devices/DisplayDevice
19 +iwctl station wlan0 show
26 +wpctl: Volume: 0.30 [MUTED]
27 +brightness: intel_backlight,backlight,4261,96%,4437
29 + state: fully-charged
32 +iwctl station wlan0 show:
34 + Connected network wlan.bugabinga.net
35 + IPv4 address 192.168.178.20
44 +- Volume widget can validate muted state immediately.
45 +- Brightness widget should target/detect `intel_backlight` and current percent parsing is available from `brightnessctl -m`.
46 +- Battery widget can validate a visible X230 battery state immediately.
47 +- WiFi widget must use iwd, not NetworkManager.
48 +- Bluetooth widget can validate adapter-powered state immediately; connected device/battery requires paired device availability.
50 +##
Quickshell ObjectModel rule 52 +Quickshell `ObjectModel` exposes a reactive list through `.values`.
57 +SomeService.items.values.find(item => ...)
58 +SomeService.items.values.length
61 +Avoid assuming raw `model[index]` is reactive.
68 +import Quickshell.Services.Mpris
71 +Relevant singleton/property:
73 +- `Mpris.players`: `ObjectModel<MprisPlayer>`.
75 +Relevant `MprisPlayer` properties:
77 +- `trackTitle`: current title or `""`.
78 +- `trackArtist`: current artist or `""`.
79 +- `isPlaying`: true when playback state is playing.
80 +- `playbackState`: enum state.
81 +- `position`: seconds; not continuously reactive unless explicitly prodded, so do not poll for Phase 2B text-only widget.
82 +- `length`: track length seconds.
83 +- `volume`: player volume, not system sink volume.
84 +- `canGoNext`, `canGoPrevious`, `canTogglePlaying` for controls later.
94 +Phase 2B display rule:
97 +const player = Mpris.players.values.find(p => p.isPlaying) || Mpris.players.values[0] || null
98 +const text = player ? `${player.trackTitle} / ${player.trackArtist}` : ""
101 +Current Ironbar parity:
103 +- Center text format: `{title} / {artist}`.
104 +- Truncate around 42 chars.
105 +- Idle hidden/empty.
106 +- Must avoid the current Ironbar 1Hz DBus error loop.
108 +##
Pipewire volume widget API 113 +import Quickshell.Services.Pipewire
116 +Relevant singleton/properties:
118 +- `Pipewire.defaultAudioSink`: default output node or `null` briefly.
119 +- `Pipewire.defaultAudioSource`: default input node or `null` briefly.
120 +- `Pipewire.nodes`: all nodes.
121 +- `Pipewire.ready`: initial sync complete.
126 +PwObjectTracker { objects: [ Pipewire.defaultAudioSink, Pipewire.defaultAudioSource ] }
129 +Without a tracker, `PwNodeAudio` properties are invalid.
131 +Relevant `PwNodeAudio` properties:
133 +- `volume`: average volume; writable; real, normally `0.0..1.0` for this setup.
134 +- `muted`: writable boolean.
135 +- `volumes`: per-channel volumes.
137 +Phase 2B display/action rule:
139 +- Display current default sink volume as percent.
140 +- If muted, use muted visual state.
141 +- Scroll up: set `audio.volume = Math.min(1.0, volume + 0.02)`.
142 +- Scroll down: set `audio.volume = Math.max(0.0, volume - 0.02)`.
143 +- Right click: `audio.muted = !audio.muted`.
144 +- Middle click: open `wiremix` through command adapter.
146 +Keep external `wpctl` only as fallback if Quickshell direct writes fail in live verification.
148 +##
Brightness widget API/boundary 150 +Quickshell has no documented stable backlight service in the current skill/API inventory.
152 +Use process adapter initially:
154 +- Read: `brightnessctl -m`
155 +- Parse CSV: `device,class,current,percent,max`
156 +- Current live shape: `intel_backlight,backlight,4261,96%,4437`
157 +- Scroll up: `brightnessctl -e4 -n2 set 5%+`
158 +- Scroll down: `brightnessctl -e4 -n2 set 5%-`
160 +Phase 2B requirements:
162 +- Use one polling process or timer, not per-frame.
163 +- Update after scroll commands.
164 +- Display ` {percentage}%`.
165 +- Match current Ironbar smooth-ish behavior as close as possible.
167 +##
UPower battery widget API 172 +import Quickshell.Services.UPower
175 +Relevant singleton/properties:
177 +- `UPower.displayDevice`: aggregate display device; may exist before ready.
178 +- `UPower.devices`: physical devices.
179 +- `UPower.onBattery`: true when discharging/running on battery.
181 +Relevant `UPowerDevice` properties:
183 +- `ready`: display device initialized.
184 +- `percentage`: percent value.
185 +- `state`: enum state.
186 +- `isLaptopBattery`: true for physical laptop battery entries in `UPower.devices`.
187 +- `timeToEmpty`, `timeToFull`: seconds.
188 +- `iconName`: system icon name.
190 +Phase 2B display/action rule:
192 +- Show only when a battery exists; X230 currently does.
193 +- Display ` {percentage}%`.
195 +- Critical <=5% and discharging.
196 +- Left/middle click opens existing upower terminal command until a native popup is planned.
198 +##
WiFi widget API/boundary 200 +Do not use Quickshell `Networking` for Phase 2B because it is NetworkManager-backed and the machine uses iwd + systemd-networkd.
202 +Use process adapter initially:
204 +- Read: `iwctl station wlan0 show`
206 +- Connected state if line `State connected`.
207 +- Current connected network can be parsed from `Connected network` but current Ironbar only shows icon.
209 +Phase 2B display/action rule:
212 +- Disconnected/off: ` off`.
213 +- Poll interval around current Ironbar `30000ms`, or event source if later discovered.
214 +- Left/middle click opens `impala` through command adapter.
215 +- No NetworkManager dependency.
217 +##
Bluetooth widget API 222 +import Quickshell.Bluetooth
225 +Relevant singleton/properties:
227 +- `Bluetooth.defaultAdapter`: default adapter.
228 +- `Bluetooth.adapters`: all adapters.
229 +- `Bluetooth.devices`: all connected devices across adapters.
231 +Relevant `BluetoothAdapter` properties:
233 +- `enabled`: adapter powered/enabled.
234 +- `state`: detailed state.
235 +- `devices`: devices connected to this adapter.
236 +- `adapterId`: e.g. `hci0`.
237 +- `name`: system adapter name.
239 +Relevant `BluetoothDevice` properties:
241 +- `connected`: current connection state; writable but Phase 2B should not toggle.
242 +- `batteryAvailable`: true if battery is reported.
243 +- `battery`: `0.0..1.0` when available.
244 +- `name`, `deviceName`: display name.
245 +- `icon`: system icon.
246 +- `paired`, `trusted`, `blocked` for future management UI.
248 +Phase 2B display/action rule:
250 +- No adapter: empty string (Ironbar `not_found`).
251 +- Adapter disabled: ``.
252 +- Adapter enabled no connected devices: ``.
253 +- Connected device without battery: ``.
254 +- Connected device with battery: ` {percent}%`.
255 +- Left/middle click opens `bluetui` through command adapter.
256 +- Do not show a Bluetooth popup in Phase 2B.
258 +##
CPU widget API/boundary 260 +Quickshell has no built-in CPU service in the current inventory.
262 +Use process adapter initially:
264 +- Prefer reading `/proc/stat` from QML/Process or a timer-backed `Process` command.
265 +- Update interval: current Ironbar `2s`.
266 +- Display: ` {cpu_percent:1}%`.
267 +- Left/middle click opens `btm` through command adapter.
269 +Implementation caution:
271 +- Avoid shelling out every frame.
272 +- A 2s timer with one lightweight read is acceptable.
274 +##
Command adapter calls needed by Phase 2B 276 +Use one shared command service rather than per-widget shell strings.
280 +- `openWifi()` -> existing `wezterm start --class impala -- impala` policy.
281 +- `openBluetooth()` -> existing `wezterm start --class bluetui -- bluetui` policy.
282 +- `openSystemMonitor()` -> existing `wezterm start --class btm -- btm` policy.
283 +- `openAudioMixer()` -> existing `wezterm start --class wiremix -- wiremix` policy.
284 +- `openBattery()` -> existing upower loop command from `hypr/modules/apps.lua` until replaced.
286 +Keep exact process boundary centralized so Hypr Lua gets simpler later.
288 +##
Phase 2B implementation order recommendation 290 +1. Add `CommandRunner.qml`/`Commands.qml` for external app launch boundaries.
291 +2. Add `StatusText.qml` or reuse `BarButton.qml` for compact text widgets.
292 +3. Add MPRIS widget first: no process boundary, direct Quickshell service.
293 +4. Add Pipewire volume widget: direct service and scroll/click writes.
294 +5. Add UPower battery widget: direct service.
295 +6. Add Bluetooth widget: direct service.
296 +7. Add WiFi widget: process adapter for iwd.
297 +8. Add CPU widget: timer/process adapter.
298 +9. Add brightness widget: process adapter and scroll commands.
299 +10. Validate all widgets with Ironbar still live.
303 +- NetworkManager is explicitly excluded for WiFi.
304 +- `Quickshell.Bluetooth`, not `Quickshell.Services.Bluetooth`, is the correct Bluetooth import for v0.3.0.
305 +- Pipewire writes require `PwObjectTracker`.
306 +- MPRIS display does not need continuous position polling.
307 +- Brightness and CPU need bounded polling/process adapters because no stable Quickshell-native service was identified.