From de5439b63b9fbb8133344dafdd879cfe75ba0388 Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Sat, 8 Oct 2011 10:52:59 +0200 Subject: Add disable_touchpad script Disables touchpad only if a TrackPoint is available. Also to be used with pm-utils when resuming from suspend. --- .scripts/disable_touchpad.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 .scripts/disable_touchpad.sh (limited to '.scripts') 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 -- cgit