Enable system-wide inverse/reverse/natural scrolling on Ubuntu

1. Get your mouse device id by running the following in a terminal, you have to choose the right one:

xinput list

Take that number you got (just the number after “id=”) and replace “{device id}” with that number in the following command:

xinput list-props {device id} | grep "Scrolling Distance"

In my case:

xinput list-props 6 | grep "Scrolling Distance"

This will output something like below, remember that “Scrolling Distance” is case-sensitive. If nothing is outputted, you’ve chosen a wrong device id, go back to step 1 and choose another one:

Evdev Scrolling Distance (270): 1, 1, 1

So 270 is your property number, 1, 1, 1 is your scrolling distance, remember this to use later.

It is case sensitive unless you use -i in the grep command. Write down the numbers you find in the output from that command (in my case it was the number 1, shown three times and separated by commas). You will use the negative values of the numbers you get in your output. Also, make sure to write down the property number (it will be in parentheses in the output; in my case, it was (270) in Ubuntu and (273) in Fedora).

Note: If you get no output containing the property “Scrolling Distance” this method will not work for you and you will need to stop here and skip to an alternate way.

2. Create a natural scrolling config file by running the following command in your open terminal:

sudo touch /usr/share/X11/xorg.conf.d/20-natural-scrolling.conf

3. Now, config the natural scrolling profile by running the following command (you can use your favorite text editor instead of nano but I use nano):

sudo nano /usr/share/X11/xorg.conf.d/20-natural-scrolling.conf

In the file you have opened in your preferred text editor, paste the following (but be sure to change the numbers to the same comma-separated numbers you got from step 3; in my case, the number was 1 so in order to make the scroll inverse, I will change 1 to -1):

Section "InputClass"
        Identifier "Natural Scrolling"
        MatchIsPointer "on"
        MatchDevicePath "/dev/input/event*"
        Option "VertScrollDelta" "-1"
        Option "HorizScrollDelta" "-1"
        Option "DialDelta" "-1"
EndSection

Save the file (Ctrl+O) and exit (Ctrl+X) the text editor. No need for a reboot. Just issue the following command (substituting the property number and the negatives of the numbers you got in the third step, and the device id you got from the second step):

xinput set-prop {device id} {property number} -1 -1 -1

In my case:

xinput set-prop 6 270 -1 -1 -1

Refer from:  Ask Ubuntu, UbuntuWiki

 

10 thoughts on “Enable system-wide inverse/reverse/natural scrolling on Ubuntu

  1. Thank you very much! This works after trying a lot of other methods – shouldn’t be so complicated 😦

  2. Thank you so much!!!

    ps* I didn’t need to do the steps 2 and 3.. that means: I didn’t create that config file. I’ve just enter the command ” xinput set-prop {device id} {property number} -1 -1 -1 ” directly, and that worked for me.

    BTW, it worked and I’m glad for you!

Leave a reply to jem0716 Cancel reply