[Debian-eeepc-devel] [SCM] Maintenance of eeepc-acpi-scripts debian package branch, master, updated. f8367bd3d1a0ceb9675ee6781aec3053efbb54f8

Damyan Ivanov dmn at debian.org
Fri Sep 5 22:40:39 UTC 2008


The following commit has been merged in the master branch:
commit ccdde5a5994382425f6d7a4825171a650fc9ec2f
Author: Damyan Ivanov <dmn at debian.org>
Date:   Sat Sep 6 01:13:12 2008 +0300

    hotkey.sh/default: add handle_blank_screen function, bound to softkey 1 (by default)
    
    Same as in the shipped OS -- turns the lid off so you can use
    the Eee as an audio player without wasting power for the screen

diff --git a/actions/hotkey.sh b/actions/hotkey.sh
index d43407c..71bcb3c 100755
--- a/actions/hotkey.sh
+++ b/actions/hotkey.sh
@@ -66,6 +66,16 @@ show_volume() {
     notify Volume $percent
 }
 
+handle_blank_screen() {
+    if [ -S /tmp/.X11-unix/X0 ]; then
+	detect_x_display
+
+	if [ -n "$XAUTHORITY" ]; then
+	    xset dpms force off
+	fi
+    fi
+}
+
 show_bluetooth() {
     if bluetooth_is_on; then
 	notify Bluetooth On
@@ -150,8 +160,8 @@ case $code in
 	;;
     0000001a)
 	# soft-buton 1
-	if [ "${SOFTBTN1_ACTION}" != 'NONE' ]; then
-	    ${SOFTBTN1_ACTION}
+	if [ "${SOFTBTN1_ACTION:-handle_blank_screen}" != 'NONE' ]; then
+	    ${SOFTBTN1_ACTION:-handle_blank_screen}
 	fi
 	;;
     0000001b)
diff --git a/debian/eeepc-acpi-scripts.default b/debian/eeepc-acpi-scripts.default
index 5906404..a85bd2e 100644
--- a/debian/eeepc-acpi-scripts.default
+++ b/debian/eeepc-acpi-scripts.default
@@ -21,6 +21,9 @@ BLUETOOTH_FALLBACK_TO_HCITOOL='yes'
 
 # Configuration of "soft" keys found on models 900 and above
 # The possible actions are:
+#  - handle_blank_screen
+#      Turns the lid off. Does not activate any screen saver.
+#      Pressing a key turns the lid back on
 #  - handle_bluetooth_toggle
 #      Toggles internal bluetooth adapter on/off.
 #      When there is no bluetooth control node, and
@@ -33,7 +36,7 @@ BLUETOOTH_FALLBACK_TO_HCITOOL='yes'
 #  - custom function name
 #      For example you can write a shell function in this file and use its name
 #      as an action. It will be called when the button is pressed
-SOFTBTN1_ACTION='NONE'
+SOFTBTN1_ACTION='handle_blank_screen'
 SOFTBTN2_ACTION='NONE'
 SOFTBTN3_ACTION='handle_camera_toggle'
 SOFTBTN4_ACTION='handle_bluetooth_toggle'

-- 
Maintenance of eeepc-acpi-scripts debian package



More information about the Debian-eeepc-devel mailing list