document the change in prompt timeout handling
[vlock.git] / scripts / thinkpad_light.sh
blob4cf34ad32e347b2bd6abeb838acb85dc339ad6b5
1 #!/bin/sh
2 # thinkpad_light.sh -- ThinkLight script for vlock,
3 # the VT locking program for linux
4 #
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.
11 set -e
13 DEPENDS="all"
15 hooks() {
16 while read hook_name ; do
17 case "${hook_name}" in
18 vlock_save)
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
25 vlock_save_abort)
26 if [ "${light_status}" = "on" ] ; then
27 echo on | sudo tee /proc/acpi/ibm/light >/dev/null
30 esac
31 done
34 if [ $# -ne 1 ] ; then
35 echo >&2 "Usage: $0 <command>"
36 exit 1
39 case "$1" in
40 hooks)
41 hooks
43 preceeds)
44 echo "${PRECEEDS}"
46 succeeds)
47 echo "${SUCCEEDS}"
49 requires)
50 echo "${REQUIRES}"
52 needs)
53 echo "${NEEDS}"
55 depends)
56 echo "${DEPENDS}"
58 conflicts)
59 echo "${CONFLICTS}"
62 echo >&2 "$0: unknown command '$1'"
63 exit 1
65 esac