summaryrefslogtreecommitdiff
path: root/.scripts
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2011-10-08 10:52:59 +0200
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2011-10-08 10:54:24 +0200
commitde5439b63b9fbb8133344dafdd879cfe75ba0388 (patch)
treec6c80b9a6aa02184778a51e383c76025aa56096d /.scripts
parent6a85079d3325c08d9e0b1c7c87afde4e9b0fb2c3 (diff)
downloaddotfiles-de5439b63b9fbb8133344dafdd879cfe75ba0388.tar.gz
dotfiles-de5439b63b9fbb8133344dafdd879cfe75ba0388.tar.bz2
dotfiles-de5439b63b9fbb8133344dafdd879cfe75ba0388.zip
Add disable_touchpad script
Disables touchpad only if a TrackPoint is available. Also to be used with pm-utils when resuming from suspend.
Diffstat (limited to '.scripts')
-rwxr-xr-x.scripts/disable_touchpad.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/.scripts/disable_touchpad.sh b/.scripts/disable_touchpad.sh
new file mode 100755
index 0000000..bd5b6d5
--- /dev/null
+++ b/.scripts/disable_touchpad.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+# Only disbale Touchpad if there is a TrackPoint
+xinput list | grep TrackPoint &> /dev/null || exit
+
+device_id=$(xinput list | sed -n "s/^.*Synaptics.*id=\([^\t]*\).*$/\\1/p")
+[[ -z "$device_id" ]] && exit 1
+
+enabled=$(xinput list-props $device_id | sed -n "s/^.*Device Enabled.*\t\(.*\)$/\\1/p")
+property=$(xinput list-props $device_id | sed -n "s/^.*Device Enabled (\([^)]*\)).*$/\\1/p")
+
+[[ $enabled -eq 1 ]] && xinput set-prop $device_id $property 0