summaryrefslogtreecommitdiffstats
path: root/helperscripts/toggletouch
blob: 55df03fbc44a3959f75a7813f66f7c680b94bc9b (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
#!/bin/sh

turn_on()
{
	synclient TouchpadOff=0
	echo "Touchpad turned on"
}

turn_off()
{
	synclient TouchpadOff=1
	echo "Touchpad turned off"
}

is_on()
{
	[ "$(synclient -l | grep TouchpadOff | cut -d'=' -f2)" -eq 0 ]
}

if [ $# -eq 1 ]; then
	if [ "$1" = "1" -o "$1" = "on" -o "$1" = "true" -o "$1" = "yes" ]; then
		turn_on
	else
		turn_off
	fi
else
	is_on && turn_off || turn_on
fi
bues.ch cgit interface