user ALL = NOPASSWD: /etc/powerlaunch/*
#!/bin/sh b=/sys/class/leds/keyboard/brightness lux=/sys/devices/platform/i2c_omap.2/i2c-0/0-0029/lux on(){ echo >$b 10 } off(){ echo >$b 0 } maybe_on(){ if [ `cat $lux` -lt 5 ] ; then on ; else off ; fi } case $1 in on) on ;; off) off ;; *) maybe_on ;; esac
keyboard_slide_open = if $islocked unlock_keys ; call keyboard_light_on keyboard_slide_close = if $relock tklock.main.lock ; call keyboard_light_off keyboard_light_on = exec "sudo /etc/powerlaunch/kb_light" keyboard_light_off = exec "sudo /etc/powerlaunch/kb_light off"