💾 Archived View for runjimmyrunrunyoufuckerrun.com › rc › at captured on 2021-12-17 at 13:26:06.

View Raw

More Information

-=-=-=-=-=-=-

#!/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