DIY Pomodoro with cron
I recently wanted to employ the Pomodoro Technique to remember to take regular breaks from the computer.
Being a fan of DIY for simple things, I decided to implement it with cron, desktop notifications and a subtle chime sound.
Execute crontab -e from a terminal and write:
0,30 * * * * DISPLAY=:0.0 notify-send -t 10000 Pomodoro 'Back to work!'; XDG_RUNTIME_DIR=/run/user/1000 paplay /usr/share/sounds/freedesktop/stereo/complete.oga
25,55 * * * * DISPLAY=:0.0 notify-send -t 10000 -u critical Pomodoro 'Time for a 5-minute break!'; XDG_RUNTIME_DIR=/run/user/1000 paplay /usr/share/sounds/freedesktop/stereo/complete.ogaThings to note:
- At
0and30minutes past you get aBack to work!notification and sound - At
25and55minutes past you get aTime for a 5-minute break!notification and sound - Notifications are automatically dismissed after 10 seconds
1000is your user id. You can get it withecho $UIDfrom a terminal.paplayplays sounds with PulseAudio/usr/share/sounds/freedesktop/stereo/complete.ogais the path to the audio file and is part of the sound-theme-freedesktop package in Debian (may be missing from your system)
If you prefer 50 minutes of work followed by a 10-minute break:
0 * * * * DISPLAY=:0.0 notify-send -t 10000 Pomodoro 'Back to work!'; XDG_RUNTIME_DIR=/run/user/1000 paplay /usr/share/sounds/freedesktop/stereo/complete.oga
50 * * * * DISPLAY=:0.0 notify-send -t 10000 -u critical Pomodoro 'Time for a 10-minute break!'; XDG_RUNTIME_DIR=/run/user/1000 paplay /usr/share/sounds/freedesktop/stereo/complete.ogaThanks to zorbash for the idea to use desktop notifications.