26

I successfully followed the answer to this question to set different sensitivities for my touchpad and my USB mouse. Only problem is, once you unplug and replug the device or shutdown, restart etc., the settings reset.

27

According to How to configure the TrackPoint (from ThinkWiki), the method for changing the settings on a per-user basis is by using the .xsessionrc file, simply put all your xinput commands into that file and you should have your settings on boot.

The settings should be remembered after you unplug and replug the same device. But if they're not then we have a bug to report. I looked into all the events that happen when input devices are detected and I don't mind telling you that it's a real mess. If you need to go to a plan B then try adding the options into x.conf.d as shown in the above website.

  • 3
    FWIW whenever I tweak my Synaptics touchpad settings with xinput, my tweaks are forgotten when I suspend and resume. Ubuntu 10.10. – Marius Gedminas Jan 6 '11 at 20:22
  • That's a bug, please report it. – Martin Owens -doctormo- Jan 6 '11 at 20:50
  • Nice, I could disable the redundant and irritating touchpad buttons without affecting horizontal/vertical scrolling: echo xinput --set-button-map 'SynPS/2 Synaptics TouchPad' 0 0 0 >> ~/.xsessionrc – Jesse Glick Sep 11 '12 at 14:47
  • 3
    On linux mint the file name is .xinputrc . :-) – inf3rno Aug 24 '15 at 4:56
  • 1
    Not a solution for plugged device after boot. – aRkadeFR Nov 5 '16 at 7:49
11

I know this is a bit old, but in Ubuntu 14.04 I couldn't find a .xsessionrc or x.conf.d file, so I had to use xinput from the terminal. This is how you do it:

  1. Check the name of your device:

    xinput list
    
  2. See available options for your device:

    xinput list-props "Your Device Name"
    
  3. Edit settings (to make settings consistent after reboot/shutdown just add this command to Startup Applications):

    xinput set-prop "Your Device Name" "Option Name" "Value"
    

    Here is an example command I used to activate locked drags in my touchpad:

    xinput set-prop "SynPS/2 Synaptics TouchPad" "Synaptics Locked Drags" 1
    

    To activate/change another option just look for it in your device available options and play with them until you get the desired result.

You now know which commands resolve your problems. They may be more than one. Your next job is to add these commands to 'Startup Applications'. To do so:

  1. Open 'Startup Applications'.

  2. Click 'Add' and in the command field paste the desired command. Click 'Add'. You have added the first command.

  3. Add the other commands too in similar fashion (if you have more than one command). You are done. Next time you restart your computer, Ubuntu will automatically run these commands which will fix your mouse issues.

  • 5
    You can just create the file in your home directory if it doesn't exist. – Ian Dunn Apr 25 '15 at 7:19
  • 1
    This looks like it will persist across a restart, but how about when the device is unplugged from USB and plugged back in (no restart involved)? – David Parks Jan 22 '17 at 20:07
  • touch .xsessionrc to create a file. – ctrl-alt-delor Jun 13 '18 at 8:28
7

I've had to put it in /etc/X11/xorg.conf.d/50-mouse-map.conf (and reboot) to be permanent not only over reboots but also over suspend/resume.

#instead of: xinput set-button-map "2.4G Wireless Optical Mouse" 1 2 3 4 5 6 7 0 
Section "InputClass"
    Identifier  "2.4G Wireless Optical Mouse"
    Option  "ButtonMapping" "1 2 3 4 5 6 7 0 0 10 11 12 13 14 15 16"
EndSection

(if I put it just in .xsession or similar it would get executed on reboot / relogin, but would still reset to defaults after suspend/resume)

  • 3
    Be careful to not just paste xinput .. commands into this .conf file but use the conf format as shown in this answer. Else you may not be able to log in graphically! This happened to me on xenial. – Fred Schoen Jun 6 '18 at 10:56
  • You can find the option names for this method in libinput(4). – Josh Aug 16 '18 at 8:19
1

Use the Statup application program

type in the terminal command and use " to separate the values

e.g

xinput set-button-map "12" "1 1 3"  

save and it works

  • 2
    That would do changes only on startup. The OP wants setting to persist when unplugged and plugged – Severus Tux Oct 12 '16 at 13:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.