Last active
December 26, 2015 10:19
-
-
Save ollar/7135890 to your computer and use it in GitHub Desktop.
Console 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 | |
echo -n "How many minutes would you like the timer to run? " | |
read limit | |
echo | |
echo "Timing $limit minutes..." | |
echo | |
counter=0 | |
while [ $counter != $limit ]; do | |
let "remain = $limit - $counter"; | |
let "slice = $remain%5" | |
printf "\r$remain minutes left...\n"; | |
if [[ "$slice" -eq "0" ]]; then | |
notify-send "Pomidorka" "$remain minutes left..."; | |
fi | |
sleep 60 | |
let "counter = $counter + 1" | |
done | |
if [ $counter = $limit ]; then | |
echo | |
echo "Time's up - $counter minutes have elapsed!" | |
notify-send "Pomidorka" "Time's up - $counter minutes have elapsed!" | |
echo -e '\a' >&2 | |
exit 0 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment