Wednesday, May 1, 2024
 Popular · Latest · Hot · Upcoming
7
rated 0 times [  7] [ 0]  / answers: 1 / hits: 7023  / 1 Year ago, tue, may 23, 2023, 8:21:32

I have a new mouse which runs on bluetooth, but I had to setup the middle mouse button manually using xinput --set-button-map. This isn't persistent after reboot, so I wrote a small python script to run it automatically after login. Unfortunately, it doesn't work because there is some delay before the mouse automatically reconnects after login.



I thought of just adding some wait into my script, but I'm sure there must be a better way to do this. Can I hook into connect events from /usr/sbin/bluetoothd or something like that instead?


More From » bluetooth

 Answers
0

I put some wait time and retries into my script and lived with that for a few days, but this weekend I had some spare time to find the "correct" solution.



That is, add the button map into a config file for X.



#/usr/share/X11/xorg.conf.d/logitech-mx-revolution.conf

Section "InputClass"
Identifier "Logitech MX Revolution Mouse"
Option "ButtonMapping" "1 2 3 4 5 6 7 9 8 10 11 12 13 14 15 2 17 18 19 20 21 22 23 24"
EndSection


Hopefully this helps someone else one day.


[#27495] Thursday, May 25, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
skipu

Total Points: 366
Total Questions: 114
Total Answers: 112

Location: Saudi Arabia
Member since Mon, Sep 5, 2022
2 Years ago
;