I have a bluetooth trackball that I use with Xorg 1.20.14. Paired up using bluetoothctl with no issues. I don't like the default pointer acceleration so I adjust it via a script when my window manager starts using the following command:
xinput set-prop 'BT4.0+2.4G Mouse' 'libinput Accel Speed' -1.0
After a period of no pointer activity the trackball will go to sleep to retain battery life. When I activate the pointer again it will reconnect to the bluetooth controller and the trackball works. These events can be witnessed via dmesg:
Quote:
[ 200.382014] input: BT4.0+2.4G Mouse as /devices/virtual/misc/uhid/0005:1915:0040.000B/input/input35
[ 200.382194] input: BT4.0+2.4G Mouse Consumer Control as /devices/virtual/misc/uhid/0005:1915:0040.000B/input/input36
[ 200.382335] hid-generic 0005:1915:0040.000B: input,hidraw8: BLUETOOTH HID v0.01 Mouse [BT4.0+2.4G Mouse] on 18:cc:18:9d:31:df
[ 215.223740] fuse: init (API version 7.34)
[ 215.822315] Bluetooth: RFCOMM TTY layer initialized
[ 215.822318] Bluetooth: RFCOMM socket layer initialized
[ 215.822321] Bluetooth: RFCOMM ver 1.11
[ 3184.538774] device br0 entered promiscuous mode
[ 3201.138412] device br0 left promiscuous mode
[57162.024736] input: BT4.0+2.4G Mouse as /devices/virtual/misc/uhid/0005:1915:0040.000C/input/input37
[57162.024901] input: BT4.0+2.4G Mouse Consumer Control as /devices/virtual/misc/uhid/0005:1915:0040.000C/input/input38
[57162.025046] hid-generic 0005:1915:0040.000C: input,hidraw8: BLUETOOTH HID v0.01 Mouse [BT4.0+2.4G Mouse] on 18:cc:18:9d:31:df
|
My problem is that after reconnecting I need to reissue the xinput command again to set my preferred pointer acceleration.
Is there a way to detect these events and have the script automatically execute after the trackball is reconnected. I assume there's some way to register a listener for events on the bluetooth controller but I've not found any method to do this.
I know can tail and react to syslog messages but I'd prefer to avoid that.