various changes around data volumes
[distro-setup] / input-setup
1 #!/bin/bash -l
2 #set -x
3 mi() {
4 xinput --get-feedbacks "$1" | grep "threshold"
5 xinput --get-feedbacks "$1" | grep "accelNum\|accelDenom"
6 xinput --list-props "$1" | grep "Device Accel Profile\|Device Accel Constant Deceleration\|Device Accel Velocity Scaling"
7 }
8 ms() {
9 xinput --set-ptr-feedback "$1" $2 ${3%/*} ${3#*/}
10 xinput --set-prop "$1" 'Device Accel Profile' $4
11 xinput --set-prop "$1" 'Device Accel Constant Deceleration' $5
12 xinput --set-prop "$1" 'Device Accel Velocity Scaling' $6
13 mi "$1"
14 }
15 set_device_id() {
16 if device_id=$(xinput --list | grep -m 1 "$1"); then
17 device_id=${device_id##*id=}
18 device_id=${device_id%%[[:space:]]*}
19 else
20 return 1
21 fi
22 }
23
24 case $HOSTNAME in
25 tp)
26 # original saved with: xkbcomp $DISPLAY /a/c/stretch-9-2016.xkb
27 xkbcomp /a/c/tp.xkb $DISPLAY
28 ;;
29 treetowl*|iank-dev|frodo|x2)
30 # todo, differentiate for work pc
31 #/a/bin/radl
32 if [[ -z $DISPLAY ]]; then
33 echo "error. empty DISPLAY var" >> /a/gdm-keyboard-error.log
34 else
35 xkbcomp /a/c/.Xkeymap $DISPLAY
36
37 xkbset m # setup mouse keys, which I have altered
38
39 xkbset exp =m # stop mousekeys expiring after a timeout
40
41 xset r rate 200 13 # decrease rate delay
42 cd / # so xbindkeys does not hold open mountpoints
43 xbindkeys # configured to grab left and right scroll button presses
44 fi
45
46
47 #right scroll wheel, change from button 4 & 5 to 13 and 14.
48 # also changes the middle click to 12, even though I'm not using it anymore
49 if set_device_id "04d9:048e"; then
50 xinput --set-button-map "$device_id" 1 12 3 13 14 6 7
51 fi
52
53 ms 'Kensington Kensington Slimblade Trackball' 100 4000/1 7 6.5 1.5
54 xinput --set-button-map 'Kensington Kensington Slimblade Trackball' 0 0 0 4 5 6 7 0 9 10 11 12
55
56 # razer naga middle mouse stopped working. it's settings were:
57 #ms "$device_id" 100 1000/1 7 4 1
58
59 if set_device_id "SteelSeries World of Warcraft MMO Gaming Mouse"; then
60 ms "$device_id" 100 1000/1 7 4 1
61 #ms "$device_id" 1 7/2 2 2.5 2
62
63 # makes it compatible with what windows sends using synergy
64 xinput --set-button-map "$device_id" 1 2 3 4 5 6 7 6 7 10 11 12 13 14 15
65
66 # under the new "improved" libinput, the mouse speed/accel has
67 # changed all around and is much more limited.
68 # Other xinput commands will fail and this will succeed.
69 xinput --set-prop "$device_id" "libinput Accel Speed" '.8'
70 fi
71
72
73 # disable the mouse movements of my mouse-wheel only mouse
74 if set_device_id "USB Optical Mouse"; then
75 xinput --set-prop "$device_id" 'Device Accel Constant Deceleration' 10000
76 # 12 is to effectively disable the middle click button
77 xinput --set-button-map "$device_id" 1 12 3 10 11 6 7
78 fi
79 /a/bin/bash_unpublished/gpg
80 ;;
81 frodo*)
82 ;;
83 esac
84
85 # for desktop and htpc
86 set_device_id "Logitech Unifying Device"
87 xinput --set-prop "$device_id" 'Evdev Middle Button Emulation' 1
88
89
90 #ms 'Kensington Kensington Slimblade Trackball' 1 7/2 2 4 5 = 2.01
91 # ms 9 10 20/1 6 4 .2
92 #ms 9 10 35/1 6 5 .2 = 1.82
93 #ms 9 10 1200/1 7 5 .2 = 1.82 after a practice round
94 #
95 #ms 9 10 140/1 6 7 .1 = 2.0 after a practice round.
96 #feels like the slow is finally too slow, and fast too fast
97 # ms 9 10 50/1 6 6 .2 = 1.83 after
98 # ms 9 10 90/1 6 6 .1 = 1.86
99 #ms 9 10 3000/1 7 6 .1 = 1.81
100 #ms 9 1 15/1 3 6 3 = 2.0
101 #ms 9 1 10/1 3 4 2 = 1.91
102 #ms 9 1 8/1 3 5 4 = 1.98
103 #ms 9 1 10/2 2 5 2.5 = 1.99
104 #ms 9 100 3000/1 7 5 1 = 1.86
105 #ms 9 100 1500/1 7 5 1.5 = 1.87
106 #ms 9 100 2200/1 7 6 1.5 = 1.81
107 #ms 9 100 2200/1 7 5 1.5 = 1.83
108 #ms 9 100 3000/1 7 6 1.5 = 1.88
109 #ms 9 1 100/1 4 6 15 = 1.85
110 #ms 9 100 3000/1 7 7 1.5 = 1.85, but had a 1.76 on first try...
111 # ms 9 100 3500/1 7 7 1.5 = 1.73, 1.68 a1 1.74, 1.83, 1.75, 1.78, 1.76
112 # ms 9 100 4000/1 7 7 1.5 = 1.80
113 # ms 9 100 4000/1 7 8 1.5 = 1.78
114 # ms 9 100 4000/1 7 8 1.8 = 1.88
115 # ms 9 100 4800/1 7 8 1.5 = 1.85
116 # ms 9 100 4000/1 7 6.5 1.5 = 1.83. stickig with this, upped speeds a bit to make it more practical for normal windows
117 # new day
118 # ms 9 100 3500/1 7 7 1.5 = 1.92
119 # ms 9 1 7/2 2 5 5 = 1.9
120 # ms 9 100 3500/1 7 7 1.5 = 1.62
121 # felt like having it a bit faster for a while, but switched back
122 #ms 'Kensington Kensington Slimblade Trackball' 100 3500/1 7 5 1.5
123
124
125 #set +x