Skip to content

Instantly share code, notes, and snippets.

@dyokomizo
Last active July 16, 2020 17:53
Show Gist options
  • Save dyokomizo/ed4aa33f6a4446b598e8a737772c215c to your computer and use it in GitHub Desktop.
Save dyokomizo/ed4aa33f6a4446b598e8a737772c215c to your computer and use it in GitHub Desktop.
A minimalist bash pomodoro
#!/bin/bash
: ${POMODORO_ALARM:="/usr/share/sounds/freedesktop/stereo/alarm-clock-elapsed.oga"}
cycle () {
[[ $# > 1 ]] && (echo $2);
for i in $(seq 1 $1);
do
if [ $(($i % 5)) -eq 0 ]
then
echo -n ":"
else
echo -n "."
fi
sleep 1m
done
echo
paplay "$POMODORO_ALARM"
}
while true
do
cycle 25 "work (1)"
cycle 5 "short break"
cycle 25 "work (2)"
cycle 5 "short break"
cycle 25 "work (3)"
cycle 5 "short break"
cycle 25 "work (4)"
cycle 5 "short break"
cycle 25 "work (5)"
cycle 35 "long break"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment