This repository has been archived on 2023-03-02. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles/.local/bin/cursor_setup

32 lines
915 B
Plaintext
Raw Normal View History

2022-11-04 10:06:07 +01:00
#!/usr/bin/env sh
######################################################################
# @author : swytch (adapted from Luke Smith - lukesmith.xyz)
# @file : cursor_setup
# @license : GPLv3
# @created : Friday Nov 04, 2022 10:02:12 CET
#
# @description : handles cursor setup in cas `xinput` lists the same
# device several times
######################################################################
if [ "$1" = "" ]; then
exit 1
fi
ids=$(xinput --list | awk -v search="$1" \
'$0 ~ search {match($0, /id=[0-9]+/);\
if (RSTART) \
print substr($0, RSTART+3, RLENGTH-3)\
}'\
)
for i in $ids
do
[ "trackpad" = "$2" ] && xinput set-prop $i 'libinput Tapping Enabled' 1 &
xinput set-prop $i 'libinput Natural Scrolling Enabled' 1 &
xinput set-prop $i 'libinput Accel Speed' 0.4 &
done