2 # shellcheck source=/a/bin/ds/.bashrc
3 if [[ -s ~
/.bashrc
]];then . ~
/.bashrc
;fi
5 # Copyright (C) 2016 Ian Kelling
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
11 # http://www.apache.org/licenses/LICENSE-2.0
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
28 xinput
--get-feedbacks "$1" |
grep "threshold"
29 xinput
--get-feedbacks "$1" |
grep "accelNum\|accelDenom"
30 xinput
--list-props "$1"
33 xinput
--set-ptr-feedback "$1" $2 ${3%/*} ${3#*/}
34 # running newer system that uses libinput and has far less
35 # customizability. I havent yet determined the best settings here.
36 if xinput
--list-props "$1" |
grep "libinput Accel Speed" &>/dev
/null
; then
37 xinput
--set-prop "$1" "libinput Accel Speed" 1
39 xinput
--set-prop "$1" 'Device Accel Profile' $4
40 xinput
--set-prop "$1" 'Device Accel Constant Deceleration' $5
41 xinput
--set-prop "$1" 'Device Accel Velocity Scaling' $6
46 if [[ $2 ]] && $2; then
51 if device_id
=$
(xinput
--list |
grep "$1" |
$cmd); then
52 device_id
=${device_id##*id=}
53 device_id
=${device_id%%[[:space:]]*}
54 echo "2:$2 device_id=$device_id"
60 # default via xset q is 660 25. (delay for autorepeat, repeat rate)
61 # was at 200 13, but while learning to use keyboardio, i hold keys a bit longer sometimes.
62 xset r rate
400 13 # decrease rate delay
64 if set_device_id
"SteelSeries World of Warcraft MMO Gaming Mouse"; then
65 ms
"$device_id" 100 1000/1 7 4 1
67 # under the new "improved" libinput, the mouse speed/accel has
68 # changed all around and is much more limited.
69 # Other xinput commands will fail and this will succeed.
70 xinput
--set-prop "$device_id" "libinput Accel Speed" '.8'
73 # todo, differentiate for work pc
78 # original saved with:
79 # setxkbmap -layout us -variant intl
80 # xkbcomp $DISPLAY /a/c/etiona-2021-intl.xkb
81 xkbcomp
/a
/c
/model01.xkb
$DISPLAY
84 xkbcomp
/a
/c
/x2.xkb
$DISPLAY
89 # for desktop and htpc
90 if set_device_id
"Logitech Unifying Device"; then
91 xinput
--set-prop "$device_id" 'Evdev Middle Button Emulation' 1
94 ## slow down ploopy trackball, until we recompile firmware
95 # id=$(xinput list | grep -F 'Ploopy Corporation Trackball Mouse' | sed -rn 's/.*[[:space:]]id=([^[:space:]]*).*/\1/p' ||:)
97 # xinput --set-prop $id 'libinput Accel Speed' -0.9