#!/bin/rc # simple alarm clock rfork e fn usage { echo >[1=2] usage: alarmclock mins[:secs] [action] exit usage } if(~ $#* 0 || ~ $1 *[~0-9:]*) usage secs = `{echo $1 | awk -F: '{print 60 * $1 + $2}'} shift if (~ $#* 0) action = (echo BBBRRRIIINNNGGG!!!) if not action = $* echo hide > /dev/wctl sleep $secs && >/dev/wctl {echo unhide;echo top} && $action