diff options
author | Anton Luka Šijanec <anton@sijanec.eu> | 2023-08-06 15:56:08 +0200 |
---|---|---|
committer | Anton Luka Šijanec <anton@sijanec.eu> | 2023-08-06 15:56:08 +0200 |
commit | 4b65846d2e369636e1c947c98c31507d4c08af10 (patch) | |
tree | ba8d82c0c1ca0e54943b86ca68f665cfd66a078f /skripti | |
parent | raw6 (diff) | |
download | r-4b65846d2e369636e1c947c98c31507d4c08af10.tar r-4b65846d2e369636e1c947c98c31507d4c08af10.tar.gz r-4b65846d2e369636e1c947c98c31507d4c08af10.tar.bz2 r-4b65846d2e369636e1c947c98c31507d4c08af10.tar.lz r-4b65846d2e369636e1c947c98c31507d4c08af10.tar.xz r-4b65846d2e369636e1c947c98c31507d4c08af10.tar.zst r-4b65846d2e369636e1c947c98c31507d4c08af10.zip |
Diffstat (limited to 'skripti')
-rwxr-xr-x | skripti/toggle_mouse.sh | 17 |
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 |