summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtouchpad.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/touchpad.sh b/touchpad.sh
new file mode 100755
index 0000000..9bb6f6f
--- /dev/null
+++ b/touchpad.sh
@@ -0,0 +1,30 @@
1#!/usr/bin/env sh
2
3case $1 in
4 "enable")
5 ACTION="enable"
6 ;;
7 "disable")
8 ACTION="disable"
9 ;;
10 *)
11 echo "Invalid action."
12 echo "Usage: $0 enable|disable"
13 exit
14 ;;
15esac
16
17DEVICES=$(xinput list --name-only | grep -i touchpad)
18
19if [ -z "$DEVICES" ]; then
20 echo "No touchpad found."
21 exit
22fi
23
24IFS='
25'
26
27for DEVICE in $DEVICES; do
28 xinput "$ACTION" "$DEVICE"
29done
30