[scripts] feat: automatic cursor setup
This commit is contained in:
parent
342d4973a3
commit
541e28595f
31
.local/bin/cursor_setup
Executable file
31
.local/bin/cursor_setup
Executable file
@ -0,0 +1,31 @@
|
||||
#!/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
|
||||
|
Reference in New Issue
Block a user