Commit Graph
33 Commits
Author SHA1 Message Date
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 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 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
Kenny Levinsen 40aec97f79 Cargo format 2025-02-27 14:48:41 +01:00
Kenny Levinsen bc9ba0045c launcher: Support launch_cmd config 2025-01-12 22:51:45 +01:00
Kenny Levinsen f09abf1d53 backlight: Auto-detect type 2025-01-12 22:47:16 +01:00
Kenny Levinsen a882e26e2b widgets/backlight: Set support 2023-11-10 14:00:48 +01:00
Kenny Levinsen 84c241a90e keyboard: Use xkb_common::keysyms 2023-11-10 14:00:06 +01:00
Kenny Levinsen 6351cc242d launcher: Use XDG_ACTIVATION_TOKEN for shell cmds 2023-04-04 01:53:29 +02:00
Kenny Levinsen 66e66e19ad launcher: Cache desktop files 2023-04-04 01:53:02 +02:00
Kenny Levinsen 3a77696569 calendar: Missed preload of 'N' 2023-03-01 11:48:25 +01:00
Kenny Levinsen 9d1f310f12 cargo fmt 2023-02-14 10:23:20 +01:00
Kenny Levinsen 54e4ba16dd Add InvertedVerticalLayout 2023-02-14 10:23:12 +01:00
Kenny Levinsen 6fac465c3a calendar: Highlight current week 2023-02-14 00:28:40 +01:00
Kenny Levinsen 5097faab66 launcher: Save prompt on exit 2023-02-14 00:28:40 +01:00
Kenny Levinsen 8202963a6f Add vertical line 2023-02-14 00:28:40 +01:00
Kenny Levinsen b09f642fd6 Avoid panic on very long prompt lines 2023-02-14 00:28:40 +01:00
Kenny Levinsen 022f6a719a cargo fmt 2023-02-13 18:49:44 +01:00
Kenny Levinsen 9e48eb053d config: Generate configs 2023-02-12 17:02:44 +01:00
Kenny Levinsen 353ed1f189 launcher: Shrink margin 2023-02-08 22:57:06 +01:00
Kenny Levinsen 45e5a750f9 calendar: Fix hiding when shrunk 2023-02-08 22:56:52 +01:00
Kenny Levinsen 6e90b1f0e8 More better 2023-02-08 22:53:41 +01:00
Kenny Levinsen 3c69a31030 calc: Store history 2023-02-07 00:36:06 +01:00
Kenny Levinsen b9f4e74062 calc: Improve history 2023-02-06 18:57:34 +01:00
Kenny Levinsen 6f0ca36826 Moar speed 2023-02-06 18:34:07 +01:00
Kenny Levinsen b49b9e9764 More stuff 2023-02-02 23:52:59 +01:00
Kenny Levinsen 7593cd48a4 Add calendar, refactor more 2023-01-16 00:25:34 +01:00
Kenny Levinsen 3a40bb18c5 Refactor slightly 2023-01-13 21:53:07 +01:00
Kenny Levinsen b2a9475e4c cargo fmt 2023-01-12 00:13:27 +01:00
Kenny Levinsen 25644c2b15 backlight: Add 2023-01-11 23:54:52 +01:00
Kenny Levinsen dd790468ad battery: Minor cleanup 2023-01-11 23:54:39 +01:00
Kenny Levinsen 0a4544a608 launcher: Add ctrl k/u handling 2023-01-11 23:54:14 +01:00
Kenny Levinsen 8e80c0a69c Initial commit 2023-01-11 00:28:54 +01:00