diff options
| author | Mitchell Riedstra <mitch@riedstra.dev> | 2024-01-20 12:31:58 -0500 |
|---|---|---|
| committer | Mitchell Riedstra <mitch@riedstra.dev> | 2024-01-20 12:31:58 -0500 |
| commit | e2a0cf2a79b43f9f86b74270f3d96fe300687804 (patch) | |
| tree | a87edf55f81e78f4d0968d6f006562090260e068 /x/mouse-props | |
| parent | ec83443853116b07f18fbef8c6de31cf157939a0 (diff) | |
| download | dotfiles-e2a0cf2a79b43f9f86b74270f3d96fe300687804.tar.gz dotfiles-e2a0cf2a79b43f9f86b74270f3d96fe300687804.tar.xz | |
Cleanup unused files and code.
Diffstat (limited to 'x/mouse-props')
| -rwxr-xr-x | x/mouse-props | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/x/mouse-props b/x/mouse-props new file mode 100755 index 0000000..a2c0d5f --- /dev/null +++ b/x/mouse-props @@ -0,0 +1,49 @@ +#!/bin/sh + +mice="G305|Viper|Naga Pro|Orochi V2|Viper V2" + +listMice() { + xinput --list \ + | awk -v "search=$mice" \ + '{ + if ($0 ~ search) { + if ( $0 ~ /pointer/ ) { + $1=$2=""; + print $0 + } + } + }' \ + | sed -re's/.* id=([0-9]*).*/\1/g' # -e's/^[ \t]*//g' +} +xinput --list | grep pointer | grep -E "$mice" +mice="$(listMice)" + +proplist='Accel Profile Enabled::0 1 +Accel Speed::0' +# Accel Speed::-0.7' + +IFS=' +' + +for device in $mice ; do + # props=$(xinput --list-props "pointer:$device") + props=$(xinput --list-props "$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 "$device" "$prop" $propVal + #shellcheck disable=SC2086 + echo xinput --set-prop "$device" "$prop" $propVal + + IFS="$oldIFS" + done +done + |
