summaryrefslogblamecommitdiffstats
path: root/skripti/toggle_mouse.sh
blob: 91a2d6651625308ec0d87fc7b21e1927818f662e (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
















                                                                                     
#!/bin/sh
set -xe
function toggle () {
	k=$(((`xinput list-props $1 | grep Device\ Enabled | cut -f3`+1)%2))
	xinput set-prop $1 "Device Enabled" $k
	echo $k > /sys/class/leds/input4\:\:capslock/brightness
}
if [ x$1 != x ]
then
	toggle $1
	exit
fi

for i in `xinput | grep SYNA | cut -f2 | cut -d= -f2 | sort -g | head -n2 | tail -n1`
do
	toggle $i
done