summaryrefslogtreecommitdiff
path: root/touchpad.sh
blob: 9bb6f6f48842d4810098a25daac8d855691c67f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env sh

case $1 in
	"enable")
		ACTION="enable"
		;;
	"disable")
		ACTION="disable"
		;;
	*)
		echo "Invalid action."
		echo "Usage: $0 enable|disable"
		exit
		;;
esac

DEVICES=$(xinput list --name-only | grep -i touchpad)

if [ -z "$DEVICES" ]; then
	echo "No touchpad found."
	exit
fi

IFS='
'

for DEVICE in $DEVICES; do
	xinput "$ACTION" "$DEVICE"
done