Skip to content

Instantly share code, notes, and snippets.

@delenamalan
Created January 31, 2020 16:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save delenamalan/91d733719404c4b9a226b6b284e66e6f to your computer and use it in GitHub Desktop.
Save delenamalan/91d733719404c4b9a226b6b284e66e6f to your computer and use it in GitHub Desktop.
Bash Pomodoro-style timer for Ubuntu
#!/bin/sh
# Pomodoro-style timer for Ubuntu
# Usage `pomodoro [WORK DURATION] [SHORT BREAK DURATION] [LONG BREAK DURATION]
while true
do
for i in {1..4}
do
sleep ${1:-25m}
notify-send "Time to take a short break"
sleep ${2:-5m}
notify-send "Time to get back to work"
done
notify-send "Time for a long break"
sleep ${3:-15m}
notify-send "Time to work"
done
@AugustinCrochat
Copy link

AugustinCrochat commented Jan 9, 2022

I hadn't thought about adding a loop to mine. Here's mine, because on XFCE notification popups are not that visible, I added sounds. I now like it even more, in fact:

The first notify-send serves as a visual reminder that the script is running, it's useful when launching from a keyboard shortcut. It plays bell sounds every 5 minutes until competing 15 minute (my preferred time for pomodoros)

notify-send -t 900000 "M" & aplay -q ~/scripts/sounds/bell.wav & sleep 300  && aplay -q ~/scripts/sounds/bell.wav && sleep 300 && aplay -q ~/scripts/sounds/bell.wav && sleep 300 && aplay -q ~/scripts/sounds/ubuntu.wav

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment