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

Damyan Ivanov dmn at debian.org
Mon Jul 21 16:00:31 UTC 2008


The following commit has been merged in the master branch:
commit 6b6f784200dafd403ada8048ccadba6bb07497b3
Author: Damyan Ivanov <dmn at debian.org>
Date:   Mon Jul 21 18:44:18 2008 +0300

    suspend.sh: lock running screensavers on suspend

diff --git a/actions/suspend.sh b/actions/suspend.sh
index 1576d81..f4797d7 100755
--- a/actions/suspend.sh
+++ b/actions/suspend.sh
@@ -7,6 +7,26 @@ if (runlevel | grep -q [06]) || (pidof '/sbin/shutdown' > /dev/null); then
     exit 0
 fi
 
+[ -r /etc/default/eeepc-acpi-scripts ] && . /etc/default/eeepc-acpi-scripts
+
+if [ "$LOCK_SCREEN_ON_SUSPEND" = "yes" ]; then
+    # activate screensaver if available
+    if [ -S /tmp/.X11-unix/X0 ]; then
+        export DISPLAY=:0
+        user=$(who | sed -n '/ (:0[\.0]*)$\| :0 /{s/ .*//p;q}')
+        home=$(getent passwd $user | cut -d: -f6)
+        XAUTHORITY=$home/.Xauthority
+        if [ -f $XAUTHORITY ]; then
+            export XAUTHORITY
+            for ss in xscreensaver gnome-screensaver; do
+                [ -x /usr/bin/$ss-command ] \
+                    && pidof /usr/bin/$ss > /dev/null \
+                    && $ss-command --lock
+            done
+        fi
+    fi
+fi
+
 brn_control=/sys/class/backlight/eeepc/brightness
 [ -e $brn_control ] || brn_control=/proc/acpi/asus/brn # pre-2.6.26
 
diff --git a/debian/eeepc-acpi-scripts.default b/debian/eeepc-acpi-scripts.default
index 3ebae91..303a6fd 100644
--- a/debian/eeepc-acpi-scripts.default
+++ b/debian/eeepc-acpi-scripts.default
@@ -10,3 +10,6 @@ HEADPHONE_LABEL='iSpeaker'
 # these are the switches for xrandr --output VGA when Fn-F5 is used to
 # select LCD+VGA mode
 COMBINED_DISPLAY_SWITCHES='--mode 640x480'
+
+# attempt to lock running xscreensaver or gnome-screensaver on suspend
+LOCK_SCREEN_ON_SUSPEND='yes'

-- 
Maintenance of eeepc-acpi-scripts debian package



More information about the Debian-eeepc-devel mailing list