Takeaway lights script

23 December 2008

I just stumbled across a simple yet fun script I wrote over a year ago to animate your keyboard LEDs:

#!/bin/sh

LED="setleds -L"
SLEEP="sleep 0.2s"

$LED -num -caps -scroll

if [ "$1" = "-c" ] ; then
	exit 0
fi

while [ 1 ] ; do
	$LED +num
	$SLEEP
	$LED +caps
	$SLEEP
	$LED +scroll
	$SLEEP
	$LED -num
	$SLEEP
	$LED -caps
	$SLEEP
	$LED -scroll
	$SLEEP
done

It will simply pulsate the keyboard LEDs from left to right. Note that this script only works while logged into a tty — it does not work under X11.

2 replies

Leave a reply