Module Name: src
Committed By: macallan
Date: Tue Sep 14 04:37:04 UTC 2010
Modified Files:
src/etc/powerd/scripts: lid_switch
Log Message:
save backlight level and turn it off on lid close, restore on lid open
To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/etc/powerd/scripts/lid_switch
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/etc/powerd/scripts/lid_switch
diff -u src/etc/powerd/scripts/lid_switch:1.5 src/etc/powerd/scripts/lid_switch:1.6
--- src/etc/powerd/scripts/lid_switch:1.5 Fri Jun 20 02:38:00 2008
+++ src/etc/powerd/scripts/lid_switch Tue Sep 14 04:37:04 2010
@@ -1,6 +1,6 @@
#!/bin/sh -
#
-# $NetBSD: lid_switch,v 1.5 2008/06/20 02:38:00 jmcneill Exp $
+# $NetBSD: lid_switch,v 1.6 2010/09/14 04:37:04 macallan Exp $
#
# Generic script for lid switch events. We try to put the system to sleep.
#
@@ -15,9 +15,15 @@
#else
# /usr/sbin/apm -d -S
#fi
+ wsconsctl -d backlight >/tmp/backlight
+ wsconsctl -d -w backlight=0 >/dev/null
exit 0
;;
released)
+ if [ -f "/tmp/backlight" ]; then
+ wsconsctl -d -w `cat /tmp/backlight`
+ fi
+ exit 0
;;
*)
logger -p warning "${0}: unsupported event ${2} on device ${1}" >&1