summaryrefslogtreecommitdiffstats
path: root/skripti/toggle_mouse.sh
diff options
context:
space:
mode:
Diffstat (limited to 'skripti/toggle_mouse.sh')
-rwxr-xr-xskripti/toggle_mouse.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/skripti/toggle_mouse.sh b/skripti/toggle_mouse.sh
new file mode 100755
index 0000000..91a2d66
--- /dev/null
+++ b/skripti/toggle_mouse.sh
@@ -0,0 +1,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