pause/README.md
agent 1bcbbfd8be Add a top-bar icon with a status menu, and a 2-hour off option
Pause now shows an eye in the GNOME top bar (open while breaks are on,
closed while they're off). Its menu shows the time to the next break and
offers Take a Break Now, Turn Off for an Hour / for 2 Hours, Turn Breaks
Back On and Quit.

It speaks StatusNotifierItem + dbusmenu over the app's own D-Bus
connection, so it needs the AppIndicator Shell extension (packaged in
Fedora) but no extra Python dependencies; libayatana-appindicator is
GTK 3 only and can't share a process with GTK 4. Without the extension
the icon just doesn't appear. Pause re-registers whenever the watcher
appears, so enabling the extension later or restarting the Shell works.

"Turn Off for 2 Hours" is also added to the app-grid right-click menu
and the status notification.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F7w6vnQked3XNiTdTZDP8r
2026-10-26 13:37:35 +00:00

102 lines
4 KiB
Markdown

# Pause
Every 25 minutes Pause fills the screen and walks you through a short break:
a few guided eye exercises, then a couple of minutes to get up and move.
You can snooze the break for 2 minutes or skip it. There's also a scratchpad
where you can write down what you were in the middle of. It gets focus as
soon as the break starts, so you can just type, and it's shown back to you
when the break ends.
Built for GNOME on Fedora (tested with GNOME Shell 50 on Wayland) with
Python, GTK 4 and libadwaita, all of which Fedora Workstation already ships.
## Install
```sh
git clone ssh://git@git.reudy.net:14922/reudy-net/pause.git ~/src/pause
~/src/pause/install.sh
pause &
```
`install.sh` doesn't need root. It adds:
- `~/.local/bin/pause`, a launcher that runs from the checkout, so `git pull` updates it
- an app-grid entry (open it to see the time left; right-click for *Take a Break Now* / *Turn Off for an Hour* / *for 2 Hours*)
- top-bar icons (see below)
- an autostart entry, so Pause starts when you log in
If it complains about missing modules: `sudo dnf install python3-gobject gtk4 libadwaita`.
Remove it with `./install.sh --uninstall` (your notes are kept).
### Top-bar icon
Pause puts an eye in the top bar: open while breaks are on, closed while
they're off. Click it for the time to the next break and *Take a Break Now*,
*Turn Off for an Hour*, *Turn Off for 2 Hours*, *Turn Breaks Back On* and
*Quit Pause*.
GNOME has no tray of its own, so this needs the AppIndicator extension, which
Fedora packages:
```sh
sudo dnf install gnome-shell-extension-appindicator
```
Log out and back in (Wayland can't reload the Shell in place), then turn on
*AppIndicator and KStatusNotifierItem Support* in the Extensions app. Pause
picks it up on its own; no restart needed. Without the extension there's no
icon, and everything else works the same.
## The break
1. A notification a minute before (**Snooze** / **Take it now**).
2. A fullscreen screen on every monitor with a countdown. The cursor is already in the scratchpad.
3. Eye exercises (look into the distance, blinking, near/far focus, eye circles,
figure eight, palming), with a chime between steps.
4. The rest of the break is for walking around. A chime tells you it's over.
5. **Welcome back** shows your note again. **Back to work** (or Ctrl+Enter)
saves it to `~/.local/share/pause/notes.md` and leaves it in the notification list.
**Snooze** keeps your note as a draft for next time. **Skip** saves the note
and restarts the 25 minutes. Alt+F4 and Escape don't close the break screen.
If you Alt+Tab away, the break screen comes back after a few seconds.
Pause also notices when you're not there. If the laptop sleeps, or you don't
touch it for 5 minutes, that counts as a break and the timer starts over. A
break that comes due while you're away waits until you're back.
## Commands
```
pause start (or show status if already running)
pause now break right now
pause snooze [MIN] postpone the next break
pause skip skip the next break
pause off [MIN] no breaks, for MIN minutes or until `pause on`
pause on
pause status
pause notes [N] your last N scratchpad notes
pause stats breaks taken / snoozed / skipped this week
pause config create ~/.config/pause/config.toml and print its path
pause quit
```
Tip: bind `pause now` or `pause off 60` to a key in *Settings → Keyboard →
Custom Shortcuts*.
## Configuration
`pause config` creates `~/.config/pause/config.toml` with every setting documented:
work/break/snooze length, warning time, idle reset, whether the break screen
pulls itself back to the front, and sounds. Restart Pause after editing it.
## Development
```sh
python3 -m unittest # scheduler, notes, exercise-plan and tray tests
python3 -m pause # run from the checkout
```
The timing logic lives in `pause/scheduler.py` and has no GTK dependency, so
it can be tested with a fake clock. The break screen is in `pause/overlay.py`, the top-bar icon
(StatusNotifierItem + dbusmenu over D-Bus) in `pause/tray.py`.