No battery on desktops; audio block controls only the default output #24

Merged
arne merged 3 commits from rail-battery-volume into main 2026-11-06 16:52:12 +01:00
Owner

Two shell fixes. The audio fix is two commits: the trim, then the volume moving onto the closed block.

No battery on a machine without one. Sensors.hasBattery now needs UPower to report a present laptop battery (isLaptopBattery && isPresent), decided at runtime, so one build is right on a laptop and a desktop. Without one, the rail's battery gauge is absent, and home's power block reads the active power profile under a lightning glyph instead of "no battery". Power profiles and stay awake are unchanged. Lock and greeter already gate on hasBattery. The NixOS module now sets services.upower.enable = mkDefault true: a laptop without UPower would otherwise lose its gauge. Charge and time left are still read from sysfs.

Audio: one key from home. The audio block's header is the volume level. With the cursor on the closed block, h/l, ←/→ and the wheel move it, and a click on the meter sets it. That is the rule level rows already follow, so changing the volume no longer means opening the block first. Enter opens it onto mute and, only with more than one output, a single output row that steps the default sink to the next device. The per-output and per-input choice rows and the mic level and mute are gone (mic mute stays on the command page). BLOCKS.me.md has a new section, "A block that is a level", for the one exception to the shared keys: l adjusts this block instead of opening it.

Tested in a nested fjordxy-dev session, with origin/fix-dev-config cherry-picked locally only (not in this branch):

  • no battery: the dev machine runs no UPower, so this was the real path. No rail gauge, and power balanced on home.
  • battery: laptopBattery forced true temporarily. The gauge and battery 59% on battery / 6h 45m remaining come back.
  • audio, driven with wtype: j to audio, l raised the sink to 45% and h lowered it to 40% (checked with wpctl) without opening the block. Enter opened it with the cursor on mute, and k reached the header. The output row was checked with its sink-count test temporarily relaxed, because the dev machine has one output. The wheel and click paths were not exercised.

Note: on a machine already running fjordxy without UPower, the battery disappears until it is rebuilt with this module.

🤖 Generated with Claude Code

Two shell fixes. The audio fix is two commits: the trim, then the volume moving onto the closed block. **No battery on a machine without one.** `Sensors.hasBattery` now needs UPower to report a present laptop battery (`isLaptopBattery && isPresent`), decided at runtime, so one build is right on a laptop and a desktop. Without one, the rail's battery gauge is absent, and home's `power` block reads the active power profile under a lightning glyph instead of "no battery". Power profiles and stay awake are unchanged. Lock and greeter already gate on `hasBattery`. The NixOS module now sets `services.upower.enable = mkDefault true`: a laptop without UPower would otherwise lose its gauge. Charge and time left are still read from sysfs. **Audio: one key from home.** The audio block's header is the volume level. With the cursor on the closed block, h/l, ←/→ and the wheel move it, and a click on the meter sets it. That is the rule level rows already follow, so changing the volume no longer means opening the block first. Enter opens it onto mute and, only with more than one output, a single `output` row that steps the default sink to the next device. The per-output and per-input choice rows and the mic level and mute are gone (mic mute stays on the command page). BLOCKS.me.md has a new section, "A block that is a level", for the one exception to the shared keys: `l` adjusts this block instead of opening it. Tested in a nested `fjordxy-dev` session, with origin/fix-dev-config cherry-picked locally only (not in this branch): - no battery: the dev machine runs no UPower, so this was the real path. No rail gauge, and `power balanced` on home. - battery: `laptopBattery` forced true temporarily. The gauge and `battery 59% on battery / 6h 45m remaining` come back. - audio, driven with wtype: j to audio, `l` raised the sink to 45% and `h` lowered it to 40% (checked with `wpctl`) without opening the block. Enter opened it with the cursor on mute, and `k` reached the header. The `output` row was checked with its sink-count test temporarily relaxed, because the dev machine has one output. The wheel and click paths were not exercised. Note: on a machine already running fjordxy without UPower, the battery disappears until it is rebuilt with this module. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Whether there is a battery is now UPower's answer — a laptop battery
device that is present — rather than "some power_supply has type
Battery", which a wireless mouse also satisfies and a desktop never
does. Decided at runtime, so one build is right on both.

Without one: the rail's battery gauge is absent, and home's power block
reads the power profile under a lightning glyph instead of "no battery".
Profiles and stay awake are unchanged. Lock and greeter already asked
Sensors.hasBattery and follow. The NixOS module enables UPower by
default, since a laptop without it would now lose its gauge. Charge and
time left are still read from sysfs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Opening the audio block now gives volume (cursor lands on it, h/l and
the wheel move it), mute, and — only with more than one output — a
single `output` row that steps the default sink to the next device.
Gone: a choice row per output, and the mic's level, mute and a choice
row per input. Mic mute stays on the command page.

Closed, the block reads the level over the device's name; the mic
detail line went with the mic rows. Audio.qml drops what nothing reads
any more (mic level, the source list, useSink/useSource) and tracks
only the default sink and source.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The audio block's header is now the volume level. With the cursor on
the closed block, h/l, ←/→ and the wheel move it and a click on the
meter sets it — the rule a level row already follows — so changing the
volume no longer means opening the block first. Enter opens it onto
mute and the output row; the volume row inside is gone, since the
header is it.

Panel learns a header that is a level (levelAt); BLOCKS.me.md, "A block
that is a level", writes down the one exception it makes: `l` adjusts
that block instead of opening it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
arne merged commit f49f147950 into main 2026-11-06 16:52:12 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
bases/fjord!24
No description provided.