32 lines
915 B
Plaintext
32 lines
915 B
Plaintext
|
#!/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
|
||
|
|