Using Linux Mint 18.1, I've remapped some mouse and keyboard keys using 'xinput' (command below). When I disconnect the mouse and reconnect it, the xinput command must be re-run manually.
I had read that adding them to ~/.xsessionrc
is the right thing to do. As you can see I've done that. I've also tried ~/.xinputrc
. It'll run once on bootup, but if I disconnect and reconnect the mouse, or sleep the computer, I need to re run the xinput command manually.
Anyone know the right way to keep these commands always active? E.g. how can I make them persist across a device disconnect/reconnect?
davidparks21@ghostmint ~ $ cat .xsessionrc
# Map mouse button 8 (top right) to button 2 (top left) and vice versa
xinput --set-button-map 10 1 8 3 4 5 6 7 2 9 10 11 12
# Fix numeric keypad for shift-home and shift-end
setxkbmap -option numpad:microsoft
.xsessionrc
runs each time you log in in graphic mode. Do you log in and back out, or do the settings change during a session? Did you disconnect or connect an input peripheral?.xsessionrc
(check your display manager (gdm/kdm/xdm/lightdm/... if it's configured to run this), you can also add a configuration inxorg.conf
for the same effects.