Last active
July 16, 2020 17:53
-
-
Save dyokomizo/ed4aa33f6a4446b598e8a737772c215c to your computer and use it in GitHub Desktop.
A minimalist bash pomodoro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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