[Debian-eeepc-commits] [SCM] Maintenance of eeepc-acpi-scripts debian package branch, master, updated. 1.1.5-8-g4d1b4f3

Darren Salt linux at youmustbejoking.demon.co.uk
Wed Dec 30 16:18:58 UTC 2009


The following commit has been merged in the master branch:
commit 4d1b4f3bc707a304c3fdfa3d58f575aacd872354
Author: Darren Salt <linux at youmustbejoking.demon.co.uk>
Date:   Wed Dec 30 16:17:08 2009 +0000

    Fix touchpad-toggling bugs; don't report anything if toggling failed.

diff --git a/debian/changelog b/debian/changelog
index 475d88c..a3d3aee 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -14,6 +14,8 @@ eeepc-acpi-scripts (1.1.6) UNRELEASED; urgency=low
   * Have the audio keys affect the 'Master' mixer control by default. This
     has a side effect: the 'Beep' control is effectively muted when 'Master'
     is muted.
+  * Fix bugs which prevent touchpad toggling from working (synclient has
+    lost -s at some point), and don't report anything if toggling failed.
 
  -- Darren Salt <linux at youmustbejoking.demon.co.uk>  Fri, 18 Dec 2009 16:48:05 +0000
 
diff --git a/etc/acpi/actions/hotkey.sh b/etc/acpi/actions/hotkey.sh
index 5aece46..cceace2 100755
--- a/etc/acpi/actions/hotkey.sh
+++ b/etc/acpi/actions/hotkey.sh
@@ -125,9 +125,15 @@ handle_shengine() {
 
 handle_touchpad_toggle() {
     . /etc/acpi/lib/touchpad.sh
-    toggle_touchpad &&
-	notify touchpad 'Touchpad on' ||
-	notify touchpad 'Touchpad off'
+    toggle_touchpad
+    case "$?" in
+	0)
+	    notify touchpad 'Touchpad on'
+	    ;;
+	1)
+	    notify touchpad 'Touchpad off'
+	    ;;
+    esac
 }
 
 handle_vga_toggle() {
diff --git a/etc/acpi/lib/touchpad.sh b/etc/acpi/lib/touchpad.sh
index 7f21390..b882d8b 100644
--- a/etc/acpi/lib/touchpad.sh
+++ b/etc/acpi/lib/touchpad.sh
@@ -7,7 +7,7 @@ detect_x_display
 toggle_touchpad()
 {
     local STATE
-    STATE="$(synclient -sl | sed -e '/TouchpadOff/! d; s/[^0-9]\+//g')"
-    synclient -s TouchpadOff=$((1-STATE))
+    STATE="$(synclient -l 2>/dev/null | sed -e '/TouchpadOff/! d; s/[^0-9]\+//g')"
+    synclient TouchpadOff=$((1-STATE)) 2>/dev/null || return 2
     return $((1-STATE))
 }

-- 
Maintenance of eeepc-acpi-scripts debian package



More information about the Debian-eeepc-commits mailing list