Add a caffeinate toggle to the power pane #3

Closed
opened 2026-08-16 22:10:09 +01:00 by joshquinlan · 2 comments
Owner

Hold the session awake on demand: a toggle in the power pane that
disables the idle behaviour while it is on.

The bar shows it: a lightning bolt either side of the clock and date
module in the centre while caffeinated, so the state is legible
without opening anything.

Should survive a hypridle restart and the docked/undocked profile
switch, and say what it is doing when it cannot take the inhibitor.

Hold the session awake on demand: a toggle in the power pane that disables the idle behaviour while it is on. The bar shows it: a lightning bolt either side of the clock and date module in the centre while caffeinated, so the state is legible without opening anything. Should survive a hypridle restart and the docked/undocked profile switch, and say what it is doing when it cannot take the inhibitor.
Author
Owner

Implemented in 05772aa.

donbox caffeine [status|on|off|toggle] holds a logind idle
lock. hypridle-common.conf leaves ignore_systemd_inhibit false,
so one lock covers dimming, the lock, the screensaver, blanking
and the undocked suspend, and it survives a hypridle restart or
a profile switch because it has nothing to do with hypridle.
Sleep is left alone so Suspend from the same pane still works.

The pane has a Stay awake section with a Caffeinate chip, and
ClockDisplay grows a bolt either side while it is on. The shell
watches ~/.local/state/donbox/caffeine rather than polling, so
turning it on from a terminal moves the bar too.

test/shell.d/caffeine-test.sh covers on, off, toggle, the
repeated-on case, and a stale record left by a reboot, against a
stub inhibitor so the suite never touches the real session.

Left open until the bolts have been seen: the visual check ran
into a magnified session and I would rather you looked than that
I moved your zoom about.

Implemented in 05772aa. `donbox caffeine [status|on|off|toggle]` holds a logind idle lock. hypridle-common.conf leaves ignore_systemd_inhibit false, so one lock covers dimming, the lock, the screensaver, blanking and the undocked suspend, and it survives a hypridle restart or a profile switch because it has nothing to do with hypridle. Sleep is left alone so Suspend from the same pane still works. The pane has a Stay awake section with a Caffeinate chip, and ClockDisplay grows a bolt either side while it is on. The shell watches ~/.local/state/donbox/caffeine rather than polling, so turning it on from a terminal moves the bar too. test/shell.d/caffeine-test.sh covers on, off, toggle, the repeated-on case, and a stale record left by a reboot, against a stub inhibitor so the suite never touches the real session. Left open until the bolts have been seen: the visual check ran into a magnified session and I would rather you looked than that I moved your zoom about.
Author
Owner

Bolts confirmed on screen. Closing.

Bolts confirmed on screen. Closing.
Sign in to join this conversation.
No milestone
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
joshquinlan/dotfiles#3
No description provided.