5b30b31e2d6128dfe247a1b8b704e257d85406f3
2 # I, Ian Kelling, follow the GNU license recommendations at
3 # https://www.gnu.org/licenses/license-recommendations.en.html. They
4 # recommend that small programs, < 300 lines, be licensed under the
5 # Apache License 2.0. This file contains or is part of one or more small
6 # programs. If a small program grows beyond 300 lines, I plan to switch
9 # Copyright 2024 Ian Kelling
11 # Licensed under the Apache License, Version 2.0 (the "License");
12 # you may not use this file except in compliance with the License.
13 # You may obtain a copy of the License at
15 # http://www.apache.org/licenses/LICENSE-2.0
17 # Unless required by applicable law or agreed to in writing, software
18 # distributed under the License is distributed on an "AS IS" BASIS,
19 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20 # See the License for the specific language governing permissions and
21 # limitations under the License.
23 # shellcheck source=/a/bin/ds/.bashrc
24 if [[ -s ~
/.bashrc
]];then . ~
/.bashrc
;fi
36 xinput
--get-feedbacks "$1" |
grep "threshold"
37 xinput
--get-feedbacks "$1" |
grep "accelNum\|accelDenom"
38 xinput
--list-props "$1"
41 xinput
--set-ptr-feedback "$1" $2 ${3%/*} ${3#*/}
42 # running newer system that uses libinput and has far less
43 # customizability. I havent yet determined the best settings here.
44 if xinput
--list-props "$1" |
grep "libinput Accel Speed" &>/dev
/null
; then
45 xinput
--set-prop "$1" "libinput Accel Speed" 1
47 xinput
--set-prop "$1" 'Device Accel Profile' $4
48 xinput
--set-prop "$1" 'Device Accel Constant Deceleration' $5
49 xinput
--set-prop "$1" 'Device Accel Velocity Scaling' $6
54 if [[ $2 ]] && $2; then
59 if device_id
=$
(xinput
--list |
grep "$1" |
$cmd); then
60 device_id
=${device_id##*id=}
61 device_id
=${device_id%%[[:space:]]*}
62 echo "2:$2 device_id=$device_id"
68 # default via xset q is 660 25. (delay for autorepeat, repeat rate)
69 # was at 200 13, but while learning to use keyboardio, i hold keys a bit longer sometimes.
70 xset r rate
400 13 # decrease rate delay
72 if set_device_id
"SteelSeries World of Warcraft MMO Gaming Mouse"; then
73 ms
"$device_id" 100 1000/1 7 4 1
75 # under the new "improved" libinput, the mouse speed/accel has
76 # changed all around and is much more limited.
77 # Other xinput commands will fail and this will succeed.
78 xinput
--set-prop "$device_id" "libinput Accel Speed" '.8'
81 # todo, differentiate for work pc
86 # original saved with:
87 # setxkbmap -layout us -variant intl
88 # xkbcomp $DISPLAY /a/c/etiona-2021-intl.xkb
89 xkbcomp
/a
/c
/model01.xkb
$DISPLAY
92 xkbcomp
/a
/c
/x2.xkb
$DISPLAY
97 # for desktop and htpc
98 if set_device_id
"Logitech Unifying Device"; then
99 xinput
--set-prop "$device_id" 'Evdev Middle Button Emulation' 1
102 ## slow down ploopy trackball, until we recompile firmware
103 id
=$
(xinput list |
grep -F 'Ploopy Corporation Trackball Mouse' |
sed -rn 's/.*[[:space:]]id=([^[:space:]]*).*/\1/p' ||
:)
105 xinput
--set-prop $id 'libinput Accel Speed' -0.7