Skip to content

Instantly share code, notes, and snippets.

@yuvilio
Last active August 29, 2015 14:14
Show Gist options
  • Save yuvilio/6ac183e8a3b12a29dfd8 to your computer and use it in GitHub Desktop.
Save yuvilio/6ac183e8a3b12a29dfd8 to your computer and use it in GitHub Desktop.
A cross-platform pomodoro style script to chunk up and track my work
#!/usr/bin/env bash
#uses
# clocker (to store the work data)
# pomojs to visualize and notify about time passing
# player to play sound to indicate when time is up
#pomodoro + break command line script
#prerequisites:
# npm install -g pomojs clocker player
#Usage
#arg1 title of task (use dashes for now rather than spaces)
#arg2 time of task
#arg3 (optional) boolean including of 5 min meditation
#ex to do work for 25 mins and then mediate for 5 mins:
#$ clocker-pom.sh "review-my-code-2" 25 1
#Sample run:
#$ clocker-pom.sh "devise-some-tests-2" 25 1
function track(){
TITLE=$1
MINS=$2
local FULL_TITLE="$TITLE for $MINS mins"
echo $FULL_TITLE
clocker start -t $FULL_TITLE
echo "clocker stop ; player play $BEEPMP3" | at now +$MINS minutes ; pomojs -d $MINS $TITLE
}
#------------------------
#Main
track $1 $2;
#add a meditate (or take a break) for five mins
MEDITATE_5=$3
if [ $MEDITATE_5 -eq 1 ]
then
track "Meditate recovery" 5;
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment