aboutsummaryrefslogtreecommitdiff
path: root/.local/bin/awesome-xinputD
blob: b8293d916c868f1cc2c23a9e2a9d4f3d63172fd1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh

apply_settings() {
    sleep 2
    xinput set-prop pointer:"Logitech USB Trackball" "libinput Accel Speed" 1.000000
    xinput set-prop pointer:"SteelSeries SteelSeries Rival 310 eSports Mouse" "libinput Accel Speed" 0.300000
    xinput set-prop pointer:"Compx 2.4G Receiver Mouse" "libinput Accel Speed" 1.000000
    if [ -f ~/.Xmodmap ]; then xmodmap ~/.Xmodmap; fi
}

apply_settings

while true; do
    state=$(lsusb)
    sleep 2
    
    if [ "$state" != "$(lsusb)" ]; then
    	apply_settings
    fi
done