aboutsummaryrefslogtreecommitdiff
path: root/misc/bin/touchpad_toggle.sh
diff options
context:
space:
mode:
authorYuchen Pei <id@ypei.org>2023-06-20 00:22:29 +1000
committerYuchen Pei <id@ypei.org>2023-06-20 00:23:00 +1000
commit351ce98112731d18d73876acf1050bd8e4f487ee (patch)
treed8ee277e6f9f9a9fa3eb8c56d91934d5b7fc1bef /misc/bin/touchpad_toggle.sh
parent06914aff2b0011d41bc50447965a8d7c6ef52c9b (diff)
Adding a buncha misc files
Also .gitignore
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