A simple Bash break reminder for MangoWM using mmsg and jq.
The script tracks active work time and reminds you to take a break by repeatedly minimizing/restoring the current window after a configurable amount of uninterrupted activity.
Fullscreen windows are ignored automatically, making it suitable for gaming, videos, or presentations.
- Tracks active work time
- Resets timer automatically after user idle
- Ignores fullscreen windows
- Visual break reminder using window minimize/restore flashing
- Warning phase before flashing by toggling maximize state
- Lightweight and minimal
- Bash
jqswayidle- MangoWM
This repository includes two script versions:
break_reminder.sh– currentmmsgsyntax usingmmsg get all-clientsandmmsg dispatch ...break_reminder_old_mmsg.sh– legacymmsgsyntax usingmmsg -g -mandmmsg -d ...
Use the one that matches your MangoWM / mmsg installation.
The script accepts optional command-line arguments using long flags, with short aliases available as well:
./break_reminder.sh \
--work-time 900 \
--idle-reset-time 300 \
--break 15 \
--pre-flashes 6 \
--tick 30 \
--mode MONITORShort aliases:
./break_reminder.sh -w 900 -i 300 -b 15 -p 6 -t 30 -m MONITOR-w,--work-time— seconds of continuous work before the reminder (default:900)-i,--idle-reset-time— seconds of idle before the timer resets automatically (default:300)-b,--break— break duration: number of flash cycles inTAGmode, or seconds of monitor sleep inMONITORmode (default:15)-p,--pre-flashes— number of maximize toggle flashes before the main reminder (default:6)-t,--tick— sleep interval between checks (default:30)-m,--mode—TAGorMONITOR(default:MONITOR)-h,--help— show usage
Default behavior:
- 15 minutes active work → trigger reminder
- 5 minutes idle resets the timer
- 15 seconds monitor sleep in
MONITORmode, or 15 tag flash cycles inTAGmode - 6 warning maximize toggles
- 30-second check interval
- The script stores the last active timestamp in:
~/.cache/break_reminder
-
It detects interruptions by checking for long sleep or inactivity gaps in its main loop, and uses
swayidleto reset the timer after idle. -
If any fullscreen window is active, the timer is reset and the reminder is delayed.
-
If the active work timer exceeds
WORK_TIME:- the active window is maximized and restored several times as a warning phase
- then the reminder runs in the selected mode:
TAG: minimize/restore the active tag repeatedlyMONITOR: sleep and wake the monitors for the configured break duration
Choose the script that matches your mmsg version:
break_reminder.sh– newmmsgsyntaxbreak_reminder_old_mmsg.sh– oldmmsgsyntax
Save the chosen script somewhere convenient, for example:
~/.local/bin/break_reminder.shMake it executable:
chmod +x ~/.local/bin/break_reminder.shIf you want to keep both versions available, rename the old one:
cp break_reminder_old_mmsg.sh ~/.local/bin/break_reminder_old_mmsg.sh
chmod +x ~/.local/bin/break_reminder_old_mmsg.shmkdir -p ~/.local/bin && \
wget -O ~/.local/bin/break_reminder.sh https://raw.githubusercontent.com/mtriam/mbreakreminder/main/break_reminder.sh && \
chmod +x ~/.local/bin/break_reminder.shIf you need the legacy version instead, replace the filename in the command above with break_reminder_old_mmsg.sh.
Add this to your MangoWM config:
exec-once = ~/.local/bin/break_reminder.sh- System sleep or long interruptions reset the timer.
- Fullscreen windows temporarily pause tracking and reset the active timer.
- No notifications, overlays, or external GUI dependencies.
GPL 3.0