Created
January 31, 2012 02:43
-
-
Save cestella/1708381 to your computer and use it in GitHub Desktop.
Simple pomodoro timer in a shell
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/sh | |
WORK_DURATION=$(echo "60 $1 * p" | dc) | |
PLAY_DURATION=$(echo "60 $2 * p" | dc) | |
echo "WORK DURATION: $WORK_DURATION seconds" | |
echo "PLAY DURATION: $PLAY_DURATION seconds" | |
while : | |
do | |
echo "WORKING FOR $1 minutes" | |
sleep $WORK_DURATION && \ | |
echo "^G" && \ | |
say "PLAY FOR $2 MINUTES" && \ | |
echo "^G" && \ | |
sleep $PLAY_DURATION && \ | |
echo "^G" && \ | |
say "WORK FOR $1 MINUTES" && \ | |
echo "^G" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment