Skip to content

Instantly share code, notes, and snippets.

@encima
Last active September 14, 2020 19:49
Show Gist options
  • Save encima/4898601f30dc9b641147 to your computer and use it in GitHub Desktop.
Save encima/4898601f30dc9b641147 to your computer and use it in GitHub Desktop.
A basic script to run pomodoro sessions in the terminal. Uses figlet, everything else comes with OS X|-|{"files":{"pomo.sh":{"env":"plain"}},"tag":"Shell"}
#!/bin/bash
# A simple script (for OS X, currently) that runs a pomodoro type session for the specified duration
c=1
while [ $c ]
do
if [ "$#" -ne 2 ]; then
echo "Usage: $0 DURATION BREAK_LENGTH" >&2
echo "Hint: 20 mins is 1200 seconds and 3 minutes is 180 seconds"
exit 1
fi
sleep ${1}
figlet TAKE A BREAK && say "Take a break"
now=$(date +"%T")
echo "Time of Pomodoro $c: $now"
for i in `seq 1 3`
do
afplay /System/Library/Sounds/Blow.aiff
sleep 0.2
done
sleep ${2}
figlet BACK TO WORK && say "Back to work"
((c++))
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment