Last active
December 31, 2015 21:08
-
-
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
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
#!/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