#!/usr/bin/env rc worktime=1530 shortbreak=300 longbreak=1800 if (~ $#1 0 || ! {echo $1 | grep -s '^[0-9]*$'} || ~ $#2 0) { echo usage: `{basename $0} reps task [...] exit } reps=$1 shift task=$"* fn notify { st=($task^':' Cycle `{eval 'echo ''#''^$i^''.''^$j'}) terminal-notifier \ -sound Submarine \ -appIcon `{dirname $0}^'/tomato.png' \ -title Pomodoro \ -subtitle $"st \ -message $"* echo $"st echo $"* } for(i in `{seq 1 $reps}) { for(j in `{seq 1 4}) { notify Get to work! sleep $worktime if(~ $i $reps && ~ $j 4) { notify Congratulations! Done! exit } breaktime=`{ ~ $j 4 && echo $longbreak || echo $shortbreak } notify Break time! $breaktime seconds. sleep $breaktime } }