Skip to content

Instantly share code, notes, and snippets.

@scmx
Last active December 31, 2015 21:08
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scmx/8044488 to your computer and use it in GitHub Desktop.
Save scmx/8044488 to your computer and use it in GitHub Desktop.
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