summaryrefslogtreecommitdiff
path: root/.scripts
diff options
context:
space:
mode:
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