2 # thinkpad_light.sh -- ThinkLight script for vlock,
3 # the VT locking program for linux
5 # This program is copyright (C) 2007 Frank Benkstein, and is free software. It
6 # comes without any warranty, to the extent permitted by applicable law. You
7 # can redistribute it and/or modify it under the terms of the Do What The Fuck
8 # You Want To Public License, Version 2, as published by Sam Hocevar. See
9 # http://sam.zoy.org/wtfpl/COPYING for more details.
16 while read hook_name
; do
17 case "${hook_name}" in
19 light_status
=$
(awk '/^status:/ {print $2}' /proc
/acpi
/ibm
/light
)
21 if [ "${light_status}" = "on" ] ; then
22 echo off | sudo
tee /proc
/acpi
/ibm
/light
>/dev
/null
26 if [ "${light_status}" = "on" ] ; then
27 echo on | sudo
tee /proc
/acpi
/ibm
/light
>/dev
/null
34 if [ $# -ne 1 ] ; then
35 echo >&2 "Usage: $0 <command>"
62 echo >&2 "$0: unknown command '$1'"