From b7b51e93543461ff66ac462747977858ee2a0724 Mon Sep 17 00:00:00 2001 From: Bernardo Magri Date: Sat, 4 Jul 2026 21:05:03 +0100 Subject: [PATCH] =?UTF-8?q?feat(bar):=20idle-inhibit=20(caffeine)=20toggle?= =?UTF-8?q?=20=E2=80=94=20generated=20bar=20+=20summer-day=20parity=20(ite?= =?UTF-8?q?m=2013=20slice)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summer-night's whole-swap bar had an idle_inhibitor the generated bar lacked (reverse parity gap from the 2026-07-04 sweep). The generated bar now carries it — 󰾪 click → 󰅶, warm tint while active, tooltips saying what it holds — blocking hypridle's lock/display-off/suspend for videos and presentations; state deliberately resets with the bar. summer-day mirrors summer-night's module + CSS, and the keybinds cheatsheet mentions the bar click (via keybinds.extra). V1: rendered config has the module with correct glyphs, CSS rules present, cheatsheet row renders. Inhibit behaviour needs a session → V3 queued. Co-Authored-By: Claude Fable 5 --- agent/BACKLOG.md | 8 +++----- agent/HARDWARE-QUEUE.md | 4 ++++ agent/JOURNAL.md | 17 +++++++++++++++++ modules/home/keybinds.nix | 1 + modules/home/waybar.nix | 20 ++++++++++++++++++-- themes/summer-day/waybar.css | 7 +++++++ themes/summer-day/waybar.jsonc | 10 +++++++++- 7 files changed, 59 insertions(+), 8 deletions(-) diff --git a/agent/BACKLOG.md b/agent/BACKLOG.md index f2e8398..d657c05 100644 --- a/agent/BACKLOG.md +++ b/agent/BACKLOG.md @@ -27,11 +27,9 @@ next, in what order*. ## NEXT ### 13. Small niceties batch (one slice per iteration) -Each is a small, self-contained polish item in the existing patterns: -- **Idle-inhibit (caffeine) toggle:** Waybar `idle_inhibitor` module - (blocks hypridle lock/suspend during video/presentations) in the - GENERATED bar — summer-night already has one (reverse parity gap - found 2026-07-04); add to summer-day too + cheatsheet mention. +Each is a small, self-contained polish item in the existing patterns +(idle-inhibit/caffeine slice shipped 2026-07-04 — generated bar + +summer-day parity + cheatsheet row): - **Low-battery notifications:** the bar colors at 25/10% but nothing *notifies*; gate on `power.laptop` (poweralertd, or a small upower watcher consistent with how the bar reads state). diff --git a/agent/HARDWARE-QUEUE.md b/agent/HARDWARE-QUEUE.md index 483921f..fba5c06 100644 --- a/agent/HARDWARE-QUEUE.md +++ b/agent/HARDWARE-QUEUE.md @@ -86,6 +86,10 @@ QA machine), the **T14s** (webcam case). `sudo nomarchy-snapshots`, restore a single file (`undochange`) and walk a root-config rollback up to (or through) the typed-`yes` gate. +- [ ] **Caffeine toggle (item 13 slice)** — click 󰾪 in the bar → turns + 󰅶 (warm tint on the generated bar) and hypridle must NOT lock / + blank while it's on (wait past the 5-min lock); click again + releases. Also present on both summer bars now. - [ ] **Screen recording (item 12)** — Tools › Capture: Record region (slurp) and Record screen produce a playable .mp4 in ~/Videos/Recordings; the red ⏺ REC appears in the bar instantly diff --git a/agent/JOURNAL.md b/agent/JOURNAL.md index 0edfb73..08896ff 100644 --- a/agent/JOURNAL.md +++ b/agent/JOURNAL.md @@ -17,6 +17,23 @@ Template: --- +## 2026-07-04 — caffeine/idle-inhibit toggle (iteration #23, item 13 slice) +- **Task:** BACKLOG NEXT#13 first slice — idle_inhibitor in the + generated bar (summer-night had it; reverse parity gap). +- **Did:** waybar.nix: idle_inhibitor module (󰾪/󰅶, tooltips, placed + after the ⏺), CSS membership + `.activated { color: @warn; }`. + summer-day: module + CSS mirrored from summer-night (same glyphs, + no tint — glyph change is the state signal there). keybinds.nix + extra row → cheatsheet mentions the bar click. +- **Verified:** V0; V1 — template-home built; rendered config has the + module second in modules-right with correct glyphs; CSS rules + present; cheatsheet row renders. Inhibit behaviour needs a session + → V3 queued (hold past the lock timeout). +- **Pending:** V3. Item 13 remaining slices: low-battery + notifications, color picker. +- **Next suggestion:** item 13 next slice (low-battery notifications, + gate on power.laptop) — or #14 lock-bump CI if variety is better. + ## 2026-07-04 — screen recording in Capture (iteration #22, item 12) - **Task:** BACKLOG NEXT#12 — record region/screen from the menu, stop from the bar. diff --git a/modules/home/keybinds.nix b/modules/home/keybinds.nix index d7c370a..f0ef4d7 100644 --- a/modules/home/keybinds.nix +++ b/modules/home/keybinds.nix @@ -76,5 +76,6 @@ { keys = "SUPER + SHIFT + 1-9"; desc = "Move window to workspace 1-9"; } { keys = "SUPER + drag"; desc = "Move (LMB) / resize (RMB) window"; } { keys = "Volume / Brightness"; desc = "Hardware keys, shown via the OSD"; } + { keys = "Bar: 󰾪 click"; desc = "Caffeine — hold the screen awake (idle inhibitor)"; } ]; } diff --git a/modules/home/waybar.nix b/modules/home/waybar.nix index 38f4170..b17134f 100644 --- a/modules/home/waybar.nix +++ b/modules/home/waybar.nix @@ -121,7 +121,7 @@ let modules-left = [ "hyprland/workspaces" "hyprland/window" ]; modules-center = [ "clock" ]; - modules-right = [ "custom/recording" "tray" "custom/vpn" "pulseaudio" "cpu" "memory" "custom/powerprofile" "custom/nightlight" ] + modules-right = [ "custom/recording" "idle_inhibitor" "tray" "custom/vpn" "pulseaudio" "cpu" "memory" "custom/powerprofile" "custom/nightlight" ] ++ lib.optional showLanguage "hyprland/language" ++ [ "battery" "custom/updates" "custom/notification" ]; @@ -155,6 +155,19 @@ let on-click = "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; }; + # Idle inhibitor (caffeine): click 󰾪 → 󰅶 to hold the screen awake — + # blocks hypridle's lock / display-off / suspend during video or a + # presentation. Waybar holds a Wayland idle-inhibit while activated; + # the state resets with the bar (deliberate — caffeine shouldn't + # survive a relogin). Summer-night's whole-swap bar had this first + # (reverse parity gap, 2026-07-04). + idle_inhibitor = { + format = "{icon}"; + format-icons = { activated = "󰅶"; deactivated = "󰾪"; }; + tooltip-format-activated = "Screen held awake — click to release"; + tooltip-format-deactivated = "Keep the screen awake (caffeine)"; + }; + # No network module: nm-applet lives in the tray (the GUI path), so the # bar's wifi/ethernet indicator would just duplicate it. @@ -296,11 +309,14 @@ let font-weight: bold; } - #tray, #pulseaudio, #cpu, #memory, #custom-powerprofile, #custom-nightlight, #custom-updates, #custom-vpn, #custom-recording, #language, #battery, #custom-notification { + #tray, #pulseaudio, #cpu, #memory, #custom-powerprofile, #custom-nightlight, #custom-updates, #custom-vpn, #custom-recording, #idle_inhibitor, #language, #battery, #custom-notification { color: alpha(@text, 0.85); padding: 0 10px; } + /* Caffeine engaged → warm tone (the screen is being held awake). */ + #idle_inhibitor.activated { color: @warn; } + /* Recording in progress → the alert red; the ⏺ is also the stop button. */ #custom-recording.recording { color: @bad; } diff --git a/themes/summer-day/waybar.css b/themes/summer-day/waybar.css index b71faca..80ea1a0 100755 --- a/themes/summer-day/waybar.css +++ b/themes/summer-day/waybar.css @@ -44,6 +44,7 @@ window#waybar { #custom-launcher, #custom-recording, +#idle_inhibitor, #clock, #clock-date, #workspaces, @@ -116,6 +117,12 @@ window#waybar { padding-right: 23px; } +#idle_inhibitor { + padding-left: 10px; + padding-right: 10px; + font-size: 20px; +} + /* Recording in progress: alert red; the module is also the stop button. */ #custom-recording.recording { color: @red; diff --git a/themes/summer-day/waybar.jsonc b/themes/summer-day/waybar.jsonc index 8e15a3e..3c7c069 100644 --- a/themes/summer-day/waybar.jsonc +++ b/themes/summer-day/waybar.jsonc @@ -11,7 +11,7 @@ "modules-left": ["custom/launcher", "clock", "clock#date"], "modules-center": ["hyprland/workspaces"], - "modules-right": ["custom/recording", "pulseaudio", "custom/powerprofile", "custom/nightlight", "hyprland/language", "custom/updates", "battery", "tray", "custom/vpn", "custom/notification", "custom/powermenu"], + "modules-right": ["custom/recording", "idle_inhibitor", "pulseaudio", "custom/powerprofile", "custom/nightlight", "hyprland/language", "custom/updates", "battery", "tray", "custom/vpn", "custom/notification", "custom/powermenu"], "hyprland/workspaces": { "disable-scroll": true, @@ -28,6 +28,14 @@ "tooltip-format": "Nomarchy menu" }, + "idle_inhibitor": { + "format": "{icon}", + "format-icons": { + "activated": " 󰅶 ", + "deactivated": " 󰾪 " + } + }, + "pulseaudio": { "format": "{icon} {volume}%", "format-bluetooth": "{icon}  {volume}%",