Skip to content

Instantly share code, notes, and snippets.

@scmx
Last active December 31, 2015 21:08
Show Gist options
  • 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