How does one go about "saving" settings in Ubuntu? I change my buttons on my trackpad using xinput set-button-map 11 3 2 1 (I'm a lefty) and it works during that session. However, when I reboot my computer, I lose my setting change, and the mouse goes back to being right-handed.

How can I get the setting to "stick" indefinitely?

Thank you!

My Machine is:

Toshiba Satellite S50-B 64-bit Ubuntu version 16.04 LTS


2 Answers 2


This should work to make it stick after log in:

Add the following command to startup Applications:

/bin/bash -c "sleep 15 && xinput set-button-map 11 3 2 1"

Open Dash > Startup Applications > Add, then add the command above.


Adding a command to Startup Applications makes the command run on log in, so this will work from the moment you are logged in.

The sleep 15 is to make sure the desktop is fully loaded before the command runs. If you leave it out, the command either breaks, misses target or is overruled by possible local procedures, setting other values. This goes specifically for mouse, keyboard and screen (xrandr) related commands.

  • 1
    Hi @JacobVlijm , do the startup applications run serially? In that case the wouldn't the sleep command delay every process? Aug 15, 2020 at 9:11

you can add the line you want executed automatically to your .bashrc file. This script is run every time you turn your computer on and every time you open a new terminal window.

  1. open the file in a text editor gedit ~/.bashrc
  2. scroll to the very bottom of the file and type your command in xinput set-button-map 11 3 2 1
  3. save the file and you're done.
  • I don't think .bashrcis run on system startup, but .profile is - that would be a better choice IMHO
    – Zanna
    Nov 20, 2020 at 1:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .