Created
March 1, 2017 19:09
-
-
Save RianFuro/f5b9d7fc1d3207f9c8d765c3da4cdbf2 to your computer and use it in GitHub Desktop.
Wrapping timewarrior with a pomodoro timer
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
#!/bin/sh | |
if [[ "$1" == "--minutes="* ]]; then | |
MINUTES="${1#--minutes=}"; shift | |
elif [[ "$1" == "-m"* ]]; then | |
MINUTES="${1#-m}"; shift | |
if [ "$MINUTES" == "" ]; then | |
MINUTES="${1}"; shift | |
fi | |
fi | |
MINUTES=${MINUTES:-25} | |
trap "timew cancel && exit" INT TERM | |
timew start pomodoro $@ 2>&1 1>/dev/null | |
sleep $(( $MINUTES * 60 )) | |
echo "Pomodoro Finished!" | |
paplay bell.wav & | |
read -p "Press [Enter] to finish task..." | |
timew stop 2>&1 1>/dev/null | |
echo "Task finished" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment