Skip to content

Instantly share code, notes, and snippets.

@scmx scmx/pomodoro.sh
Last active Dec 31, 2015

Embed
What would you like to do?
Minimalistic pomodoro for OSX with Skype integration. EDIT: Here is an alternative: https://gist.github.com/scmx/8234441
#!/usr/bin/env bash
usage() {
cat <<EOD
Usage:
pomodoro [minutes] Start a pomodoro, defaults to 25 minutes
EOD
}
case "$1" in
-h|--help) usage; exit;;
esac
minutes=25
if [ $# -gt 0 ]; then
minutes=$1
shift
fi
set_skype_status() {
osascript <<EOD
tell application "Skype"
send command "SET USERSTATUS $1" script name "disturber"
end tell
EOD
}
finish() {
echo
set_skype_status ONLINE
echo pomodoro completed
say -v albert 'pomodoro'
}
trap finish EXIT
echo Starting pomodoro $(date +%H:%M:%S)
set_skype_status DND
while true; do
sleep 60
let "minutes--"
[ $minutes -le 0 ] && break
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.