Add a top-bar icon with a status menu, and a 2-hour off option #2

Merged
reudy merged 1 commit from session/add-gnome-icon-with-status-and-o into initial-app 2026-10-26 14:39:14 +01:00
Member

Why

Pause runs in the background with nothing visible, so you can't tell whether breaks are on or how long until the next one without running pause status. This adds a top-bar icon with a status menu. It also adds a "Turn Off for 2 Hours" option.

What

  • Top-bar icon (pause/tray.py): an eye that's open while breaks are on and closed while they're off. Clicking it opens a menu:
    • the status line ("Next break in 12 min", "Breaks are off until 15:30", "On a break")
    • Take a Break Now, Turn Breaks Back On (each shown only when it applies)
    • Turn Off for an Hour, Turn Off for 2 Hours
    • Quit Pause
  • How it works: it speaks StatusNotifierItem + dbusmenu directly over the app's existing D-Bus connection, with no new dependencies. libayatana-appindicator is GTK 3 only and can't be loaded alongside GTK 4.
  • What it needs: the AppIndicator Shell extension (sudo dnf install gnome-shell-extension-appindicator). Without it there's no icon, and everything else works as before. Pause registers again whenever the watcher appears, so enabling the extension later or restarting the Shell needs no restart of Pause.
  • 2 hours off is also in the app-grid right-click actions and the status notification.
  • Installer and docs: install.sh installs and uninstalls the two symbolic icons, and hints at the extension if it's missing. The README documents the setup.

Testing

  • python3 -m unittest: all 25 pass. The new tests/test_tray.py runs the tray on a private D-Bus with a fake watcher. It checks registration, properties, layout, click → action, and that signals fire only on changes.
  • The real app under Xvfb on a private session bus, driven with gdbus the way the extension would: the layout was correct, "Turn Off for 2 Hours" turned breaks off until now + 2h and switched to the closed-eye icon, and "Quit Pause" stopped the app.
  • install.sh / --uninstall against a throwaway HOME.
  • Not tested: the real GNOME Shell with the AppIndicator extension, because the dev box doesn't have it. Please check on Fedora that the icon and menu appear and that the symbolic icon takes the panel's colour.

🤖 Generated with Claude Code

https://claude.ai/code/session_01F7w6vnQked3XNiTdTZDP8r

## Why Pause runs in the background with nothing visible, so you can't tell whether breaks are on or how long until the next one without running `pause status`. This adds a top-bar icon with a status menu. It also adds a "Turn Off for 2 Hours" option. ## What - **Top-bar icon** (`pause/tray.py`): an eye that's open while breaks are on and closed while they're off. Clicking it opens a menu: - the status line ("Next break in 12 min", "Breaks are off until 15:30", "On a break") - Take a Break Now, Turn Breaks Back On (each shown only when it applies) - Turn Off for an Hour, Turn Off for 2 Hours - Quit Pause - **How it works:** it speaks StatusNotifierItem + dbusmenu directly over the app's existing D-Bus connection, with no new dependencies. `libayatana-appindicator` is GTK 3 only and can't be loaded alongside GTK 4. - **What it needs:** the AppIndicator Shell extension (`sudo dnf install gnome-shell-extension-appindicator`). Without it there's no icon, and everything else works as before. Pause registers again whenever the watcher appears, so enabling the extension later or restarting the Shell needs no restart of Pause. - **2 hours off** is also in the app-grid right-click actions and the status notification. - **Installer and docs:** `install.sh` installs and uninstalls the two symbolic icons, and hints at the extension if it's missing. The README documents the setup. ## Testing - `python3 -m unittest`: all 25 pass. The new `tests/test_tray.py` runs the tray on a private D-Bus with a fake watcher. It checks registration, properties, layout, click → action, and that signals fire only on changes. - The real app under Xvfb on a private session bus, driven with `gdbus` the way the extension would: the layout was correct, "Turn Off for 2 Hours" turned breaks off until now + 2h and switched to the closed-eye icon, and "Quit Pause" stopped the app. - `install.sh` / `--uninstall` against a throwaway HOME. - **Not tested:** the real GNOME Shell with the AppIndicator extension, because the dev box doesn't have it. Please check on Fedora that the icon and menu appear and that the symbolic icon takes the panel's colour. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01F7w6vnQked3XNiTdTZDP8r
agent added 1 commit 2026-10-26 14:37:49 +01:00
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
reudy merged commit e45d85efa5 into initial-app 2026-10-26 14:39:14 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
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: reudy-net/pause#2
No description provided.