Skip to content

Instantly share code, notes, and snippets.

@RianFuro
Created March 1, 2017 19:09
Show Gist options
  • Save RianFuro/f5b9d7fc1d3207f9c8d765c3da4cdbf2 to your computer and use it in GitHub Desktop.
Save RianFuro/f5b9d7fc1d3207f9c8d765c3da4cdbf2 to your computer and use it in GitHub Desktop.
Wrapping timewarrior with a pomodoro timer
#!/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