6c78b9e9a29df2d8f99ebbe8e90d06f55baf41a8
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.
25 set -e; .
/usr
/local
/lib
/bash-bear
; set +e
27 script_name
="${0##*/}"
30 m
() { printf "$script_name: %s\n" "$*"; "$@"; }
32 ## disabed because unused
34 # xinput --set-ptr-feedback "$1" $2 ${3%/*} ${3#*/}
35 # # running newer system that uses libinput and has far less
36 # # customizability. I havent yet determined the best settings here.
37 # if xinput --list-props "$1" | grep "libinput Accel Speed" &>/dev/null; then
38 # m xinput --set-prop "$1" "libinput Accel Speed" 1
40 # m xinput --set-prop "$1" 'Device Accel Profile' $4
41 # m xinput --set-prop "$1" 'Device Accel Constant Deceleration' $5
42 # m xinput --set-prop "$1" 'Device Accel Velocity Scaling' $6
44 # xinput --get-feedbacks "$1" | grep "threshold"
45 # xinput --get-feedbacks "$1" | grep "accelNum\|accelDenom"
46 # xinput --list-props "$1"
49 # if [[ $2 ]] && $2; then
54 # if device_id=$(xinput --list | grep "$1" | $cmd); then
55 # device_id=${device_id##*id=}
56 # device_id=${device_id%%[[:space:]]*}
57 # echo "2:$2 device_id=$device_id"
68 if [[ ! $type ]]; then
69 if xinput |
grep -i keyboardio
; then
76 # start auto-repeat faster, but go slower.
78 # default via xset q is 660 25. (delay for autorepeat, repeat rate). At
79 # one point I used 200 13, but while learning to use keyboardio, i found
81 m xset r rate
400 13 # decrease rate delay
83 # # disabled because i'm not using it atm 2024
84 # if set_device_id "SteelSeries World of Warcraft MMO Gaming Mouse"; then
85 # ms "$device_id" 100 1000/1 7 4 1
86 # # under the new "improved" libinput, the mouse speed/accel has
87 # # changed all around and is much more limited.
88 # # Other xinput commands will fail and this will succeed.
89 # xinput --set-prop "$device_id" "libinput Accel Speed" '.8'
92 # todo, differentiate for work pc
97 # at some point, I found the international variant useful:
98 # setxkbmap -layout us -variant intl
99 # xkbcomp $DISPLAY xkbcomp-t9-intl.xkb
101 # I create these for a new os by comparing the diff with the default
102 # of previous os, then recreating the diff manually on the new
103 # default. the x2 version has changes on top of keyboardio, so
104 # create the keyboardio one first.
106 # xkbcomp $DISPLAY xkbcomp-t12.xkb
107 # cp xkbcomp-t12.xkb keyboardio-t12.xkb
108 # diff xkbcomp-t9.xkb keyboardio-t9.xkb
109 # g keyboardio-t12.xkb
111 # cp keyboardio-t12.xkb x2-t12.xkb
112 # diff xkbcomp-t9.xkb x2-t9.xkb
114 m xkbcomp
/a
/c
/keyboardio-t12.xkb
$DISPLAY
117 m xkbcomp
/a
/c
/x2-t12.xkb
$DISPLAY
121 ## disabled because i'm not using it atm.
122 # for desktop and htpc
123 # if set_device_id "Logitech Unifying Device"; then
124 # xinput --set-prop "$device_id" 'Evdev Middle Button Emulation' 1
127 ## slow down ploopy trackball, until we recompile firmware
128 id
=$
(xinput list |
grep -F 'Ploopy Corporation Trackball Mouse' |
sed -rn 's/.*[[:space:]]id=([^[:space:]]*).*/\1/p' ||
:)
130 m xinput
--set-prop $id 'libinput Accel Speed' -0.7