Commit Graph
9 Commits
Author SHA1 Message Date
Bendik Aagaard LynghaugandClaude Fable 5.1 856f8d8bf4 readme: document the fork and /etc/wldash/config.yml precedence
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-03 09:15:57 +00:00
Bendik Aagaard LynghaugandClaude Fable 5.1 eea3a78140 main: clear error messages and exit codes instead of panics
Missing/invalid config, unwritable config target, failed Wayland connect
and bad arguments now print one line to stderr and exit 1 rather than
panicking with "uh" or a serde backtrace.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-03 09:15:56 +00:00
Bendik Aagaard LynghaugandClaude Fable 5.1 8c319cffc6 keyboard/state: handle repeat rate 0, let widgets see Escape
- wl_keyboard.repeat_info with rate 0 means "no repeat"; we divided by it.
- an unknown keymap format hit unreachable!() instead of being ignored.
- raw keycode 1 (Escape) returned before widgets were dispatched, so the
  launcher's Escape handler (which saves the prompt for Ctrl+R) never ran.
  Dispatch first, then fall back to quitting.
- always lay out on the first layer-surface configure, even when the
  compositor hands us exactly the placeholder dimensions.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-03 09:15:56 +00:00
Bendik Aagaard LynghaugandClaude Fable 5.1 450a20bf63 widget: fix Geometry::expand using other.height twice
The bounding-box height was computed from other.height + other.height
instead of other.height + other.y, so the combined damage rectangle sent
to the compositor was wrong whenever a widget's drawn area changed.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-03 09:15:55 +00:00
Bendik Aagaard LynghaugandClaude Fable 5.1 6af81b587c buffer: switch to memmap2, destroy shm pools, never underflow refcounts
memmap 0.7 is unmaintained (RUSTSEC-2020-0077); memmap2 is a drop-in
replacement. Drop the unused shlex dependency.

Each resize created a new wl_shm_pool that was never destroyed; keep the
pool on the buffer and destroy it with it. A wl_buffer.release for a
buffer we didn't consider acquired used to underflow refcnt and wedge
rendering. Fix the lifetime-elision warnings while here.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-03 09:15:54 +00:00
Bendik Aagaard LynghaugandClaude Fable 5.1 c033335912 widgets: stop aborting on machines without backlight/battery/pulseaudio
The release profile builds with panic = "abort", so a panic in any helper
thread took the whole dashboard down:

- backlight: WalkDir yields /sys/class/backlight itself, so detect() was
  always true and new() picked the class dir as the device, then panicked
  reading brightness. Use min_depth(1) and tolerate read errors.
- battery: detect() only checked that UPower's DisplayDevice answered,
  which it does on every machine; use IsPresent. The monitor thread now
  returns an error instead of unwrapping, and publishes its first reading.
- pulseaudio: a failed connection panicked ("damn"); clicks before the
  first sink query unwrapped a None channel map. Both are now handled, and
  the connect loop no longer busy-spins.
- bar widget: don't underflow when narrower than the label column.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-03 09:15:54 +00:00
Bendik Aagaard LynghaugandClaude Fable 5.1 01af00b5ea desktop: hash entries the same way they compare, only parse *.desktop
Desktop derived Hash over every field but PartialEq compared only the
name, violating the Hash/Eq contract the launcher's HashMap relies on
(clippy denies this by default, so `cargo clippy` failed to build).

Also skip directories and files without a .desktop extension (mimeinfo
cache, .directory files, ...) and stop unwrapping non-UTF-8 paths.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-03 09:15:53 +00:00
Bendik Aagaard LynghaugandClaude Fable 5.1 2bed8b7fac launcher: make the prompt cursor consistently grapheme-based
set(), end() and move_cursor() used the byte length of the input as the
cursor bound while append/backspace/delete/clear_* index a grapheme table.
Any non-ASCII input (æøå, emoji) followed by End or typing past the end
indexed out of bounds and, with panic = "abort" in release, killed wldash.

While here:
- clamp Up so the selection can't run past the last row (every widget now
  reports its row count), and make mouse selection underflow-safe
- strip all desktop-entry field codes from Exec (%i %c %k ... and %% -> %),
  not just %f/%F/%u/%U
- report a failed spawn instead of panicking
- size the highlight colour table by chars, matching the drawing code

Adds unit tests for the prompt and the field-code stripping.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-03 09:15:53 +00:00
Bendik Aagaard LynghaugandClaude Opus 4.8 1367bd8591 config: prefer machine-local /etc/wldash/config.yml when present
On a shared (NFS-roamed) home, ~/.config/wldash/config.yml is identical on
every machine. Prefer a host-specific /etc/wldash/config.yml when it exists so
each machine can keep its own layout without conflicting; --config still
overrides both. Enables the 'factor host-specific config to /etc' pattern for
shared-home fleets.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-16 14:16:22 +02:00