aboutsummaryrefslogtreecommitdiff
path: root/misc/bin/touchpad_toggle.sh
diff options
context:
space:
mode:
Diffstat (limited to 'misc/bin/touchpad_toggle.sh')
-rwxr-xr-xmisc/bin/touchpad_toggle.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/misc/bin/touchpad_toggle.sh b/misc/bin/touchpad_toggle.sh
new file mode 100755
index 0000000..93bf5e2
--- /dev/null
+++ b/misc/bin/touchpad_toggle.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+# Toggle the touchpad, if there is one
+
+# Guess the touchpad name
+touch_name=$(xinput list --name-only | grep -i touchpad)
+
+if [ -n "$touch_name" ]; then
+ if xinput list-props "$touch_name" | grep 'Device Enabled .*:.*1'; then
+ xinput set-prop "$touch_name" "Device Enabled" 0
+ else
+ xinput set-prop "$touch_name" "Device Enabled" 1
+ fi
+fi