6

I am running Ubuntu 18.04.2 LTS with the standard gdm3 display manager. I would need to adjust the mouse speed, which I can do with xinput, using the following two commands in my case:

xinput set-prop 9 287 0, 1
xinput set-prop 9 284 -0.9

The only problem is that I can't make these settings permanent after reboot. If I place them into ~/.bashrc, then they do work fine after opening a new terminal window, but I would like to achieve the same already when the desktop has started (preferable already being active at the long-in screen).

Following this thread I did try to add these commands into ~/.xsessionrc, but also to several other different locations, like: /etc/profiles, ~/.xinputrc, /etc/X11/xinit/xinitrc, or /etc/X11/xinit/xinputrc, but none of them had effect after xwindows was up.

Any suggestions directing me to the correct path would be highly appreciated!

xinput details: (unfortunately there are multiple ids with the same name "Razer Razer DeathAdder Elite", hence I have to use the id number = 9):

⎡ Virtual core pointer                       id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ Razer Razer DeathAdder Elite              id=9    [slave  pointer  (2)]
⎜   ↳ Razer Razer DeathAdder Elite              id=10   [slave  pointer  (2)]
⎜   ↳ Razer Razer Ornata Chroma                 id=13   [slave  pointer  (2)]
⎜   ↳ Razer Razer Ornata Chroma                 id=14   [slave  pointer  (2)]
⎣ Virtual core keyboard                     id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ↳ Power Button                              id=6    [slave  keyboard (3)]
    ↳ Power Button                              id=7    [slave  keyboard (3)]
    ↳ HD Webcam C525                            id=8    [slave  keyboard (3)]
    ↳ Razer Razer DeathAdder Elite              id=11   [slave  keyboard (3)]
    ↳ Razer Razer Ornata Chroma                 id=12   [slave  keyboard (3)]
    ↳ Razer Razer DeathAdder Elite              id=15   [slave  keyboard (3)]
    ↳ Razer Razer Ornata Chroma                 id=16   [slave  keyboard (3)]

xinput list-props 9 output, highlighting the two relevant ones:

    ...
    libinput Accel Speed (284):   -0.900000
    libinput Accel Speed Default (285): 0.000000
    libinput Accel Profiles Available (286):    1, 1
    libinput Accel Profile Enabled (287): 0, 1
    libinput Accel Profile Enabled Default (288):   1, 0
    ...

3 Answers3

5

Option 1:

Edit /usr/share/X11/xorg.conf.d/40-libinput.conf

And add there 2 lines to the first section before EndSection:

Option "AccelProfile" "flat"
Option "AccelSpeed" "-0.9"

Like this

Section "InputClass"
    Identifier "libinput pointer catchall"
    MatchIsPointer "on"
    MatchDevicePath "/dev/input/event*"
    Driver "libinput"
    Option "AccelProfile" "flat"
    Option "AccelSpeed" "-0.9"
 EndSection

Option 2:

Use evdev instead of libinput.

Option 3:

Add the 2 commands into "Startup Applications"

Pilot6
  • 92,041
3

Answer:

  • Hit the "Windows" key
  • Type "Start" and click the "Startup Applications Preferences" icon.
  • In the "Startup Applications Preferences" window, click the "Add" button.
  • Enter a "Name" in the name field
  • Enter "xinput set-prop 9 287 0, 1" in the "Command" field
  • Give it a brief description in the "Description" field
  • Click "Add"
  • Repeat the above five (5) steps for the other command.
  • Alternatively, chain both commands into "xinput set-prop 9 287 0, 1 && xinput set-prop 9 284 -0.9" and enter that in the "Command" field.

I've found this approach both clean and effective for my touchpad, and it should work for the mouse as well. Best of luck.

ghedger42
  • 53
  • 8
1

Option 1 persisted for me after reboot because I edited as the owner (root) and all is well with my ''Primax Kensington Eagle Trackball'

Ubuntu 18.04 upgraded to 20.04 converted to Xubuntu here (not that it should matter but it never hurts to be specific).

/usr/ is owned by root but can be viewed by other gedit users without ability to save changes. If in doubt as to who can edit what review file permissions.