diff options
| author | Mitchell Riedstra <mitch@riedstra.dev> | 2023-01-10 21:54:44 -0500 |
|---|---|---|
| committer | Mitchell Riedstra <mitch@riedstra.dev> | 2023-01-10 21:55:09 -0500 |
| commit | 03160c3ffe02b67589b23d240a5df38cf18e6982 (patch) | |
| tree | f0d19f740615626805c77035c1fcb40f3e406665 /bin/touchpad-props.sh | |
| parent | 94c9429abbc1d757aaf59e786d5aaa33fc9aabe6 (diff) | |
| download | dotfiles-03160c3ffe02b67589b23d240a5df38cf18e6982.tar.gz dotfiles-03160c3ffe02b67589b23d240a5df38cf18e6982.tar.xz | |
Add a small script for adjusting touchpad properites
Diffstat (limited to 'bin/touchpad-props.sh')
| -rwxr-xr-x | bin/touchpad-props.sh | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/bin/touchpad-props.sh b/bin/touchpad-props.sh new file mode 100755 index 0000000..0851486 --- /dev/null +++ b/bin/touchpad-props.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +touchpads="$(xinput list --name-only | grep Touchpad)" + +proplist='Click Method Enabled::0 1 +Tapping Enabled::1 +Tapping Drag Enabled::1 +Tapping Button Mapping Enabled::1 0' + +IFS=' +' + +for device in $touchpads ; do + 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 |
