/
dt13.xinput
35 lines (29 loc) · 935 Bytes
/
dt13.xinput
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# this file should run at start of X session
# like put in /etc/X11/Xsession.d/96dt13-xinput
# to run touchpad and trackpoint speed
# run in sub shell, prevent variable pollute
(
max_speed=1.0
xinput_id() {
local name
name="$1"
xinput --list --short | \
grep -i $name | \
sed -E 's/^.*id=([[:digit:]]*).*?/\1/'
}
xinput_prop_id() {
local device name
device="$1"
prop="$2"
xinput --list-props $device | \
grep --max-count 1 "$prop" | \
sed -E "s/^.*$prop \(([[:digit:]]+)\).*/\1/"
}
touchpad=$(xinput_id touchpad)
tap=$(xinput_prop_id $touchpad 'Tapping Enabled')
xinput --set-prop $touchpad $tap 1
speed=$(xinput_prop_id $touchpad 'Accel Speed')
xinput --set-prop $touchpad $speed $max_speed
trackpoint=$(xinput_id trackpoint)
xinput --set-prop $trackpoint $speed $max_speed
)