diff options
Diffstat (limited to 'bin')
| -rw-r--r-- | bin/mouse-props | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/bin/mouse-props b/bin/mouse-props new file mode 100644 index 0000000..94a151e --- /dev/null +++ b/bin/mouse-props @@ -0,0 +1,31 @@ +#!/bin/sh + +mice="$(xinput list --name-only | grep -E 'Logitech G305' )" + +proplist='Accel Profile Enabled::0 1 +Accel Speed::-0.7' + +IFS=' +' + +for device in $mice ; do + props=$(xinput --list-props "pointer:$device") + + for prop in $proplist ; do + propName="$(echo "$prop" | awk -F:: '{print $1}')" + propVal="$(echo "$prop" | awk -F:: '{print $2}')" + + prop="$(echo "$props" | + sed -rne 's/^.*'"$propName"' \(([0-9]+).*$/\1/ip')" + oldIFS="$IFS" + IFS=' ' + + #shellcheck disable=SC2086 + xinput --set-prop "pointer:$device" "$prop" $propVal + #shellcheck disable=SC2086 + echo xinput --set-prop "pointer:$device" "$prop" $propVal + + IFS="$oldIFS" + done +done + |
