💾 Archived View for runjimmyrunrunyoufuckerrun.com › rc › at captured on 2022-01-08 at 13:38:25.

View Raw

More Information

⬅️ Previous capture (2021-12-17)

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

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