Add Pause: fullscreen break reminder with eye exercises and scratchpad

Every 25 minutes a fullscreen break screen (one per monitor) guides you
through eye exercises and then a walk. You can snooze it for 2 minutes or
skip it. A scratchpad, focused as soon as the break starts, records what
you were in the middle of and shows it back when the break ends.

- Python + GTK 4 + libadwaita, runs in the background as a GApplication
- CLI: now, snooze, skip, off/on, status, notes, stats, config, quit
- Idle and suspend detection through Mutter's IdleMonitor
- Warning notification with Snooze / Take it now buttons
- install.sh for a per-user install with autostart and an app-grid entry
- Unit tests for the scheduler, notes and exercise plan

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AVT21e1qRMx6WM5n8eoLNA
This commit is contained in:
agent 2026-09-28 14:20:24 +00:00
parent 915eaffd51
commit fdd43c389b
18 changed files with 1383 additions and 0 deletions

48
install.sh Executable file
View file

@ -0,0 +1,48 @@
#!/bin/sh
# Install Pause for the current user, running straight from this checkout
# (so `git pull` updates it). Use --uninstall to remove it again.
set -eu
REPO=$(cd "$(dirname "$0")" && pwd)
BIN=${XDG_BIN_HOME:-$HOME/.local/bin}
DATA=${XDG_DATA_HOME:-$HOME/.local/share}
CONFIG=${XDG_CONFIG_HOME:-$HOME/.config}
APP_ID=net.reudy.Pause
DESKTOP=$DATA/applications/$APP_ID.desktop
AUTOSTART=$CONFIG/autostart/$APP_ID.desktop
ICON=$DATA/icons/hicolor/scalable/apps/$APP_ID.svg
if [ "${1:-}" = "--uninstall" ]; then
"$BIN/pause" quit 2>/dev/null || true
rm -f "$BIN/pause" "$DESKTOP" "$AUTOSTART" "$ICON"
echo "Pause removed. Your notes are still in $DATA/pause/."
exit 0
fi
if ! python3 -c 'import gi; gi.require_version("Gtk", "4.0"); gi.require_version("Adw", "1")' 2>/dev/null; then
echo "GTK 4 / libadwaita for Python are missing. On Fedora:" >&2
echo " sudo dnf install python3-gobject gtk4 libadwaita" >&2
exit 1
fi
mkdir -p "$BIN" "$(dirname "$DESKTOP")" "$(dirname "$AUTOSTART")" "$(dirname "$ICON")"
cat > "$BIN/pause" <<EOF
#!/bin/sh
PYTHONPATH="$REPO\${PYTHONPATH:+:\$PYTHONPATH}" exec python3 -m pause "\$@"
EOF
chmod +x "$BIN/pause"
sed "s|@BIN@|$BIN|g" "$REPO/data/$APP_ID.desktop" > "$DESKTOP"
sed "s|@BIN@|$BIN|g" "$REPO/data/$APP_ID.autostart.desktop" > "$AUTOSTART"
cp "$REPO/data/$APP_ID.svg" "$ICON"
update-desktop-database "$DATA/applications" 2>/dev/null || true
gtk-update-icon-cache -q "$DATA/icons/hicolor" 2>/dev/null || true
echo "Installed. Pause starts automatically when you log in."
echo "Start it now with: pause &"
case ":$PATH:" in
*":$BIN:"*) ;;
*) echo "Note: $BIN is not in your PATH; use $BIN/pause" ;;
esac