summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPacien TRAN-GIRARD2016-03-07 11:57:25 +0100
committerPacien TRAN-GIRARD2016-03-07 11:57:25 +0100
commit690efe35a852fdc625a74f4bb23b9836eb422f2f (patch)
tree43394b939a6f87c885682171f5ebcf0648149952
parenta2e1d274224e7e5e6a9afd519fdbe5276c4f08c1 (diff)
downloaddesktop-utilities-690efe35a852fdc625a74f4bb23b9836eb422f2f.tar.gz
Add touchpad control script
-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