Sign up ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Is there any way to enable inverse scrolling like on Mac OSX?

share|improve this question

7 Answers 7

up vote 12 down vote accepted

UPDATE: This solution does not work for apps that use GTK3, such as core Gnome apps like Nautilus (file browser). See D Charles Pyle's answer below for a workaround that works in all applications. Or follow Gnome bug 682457 for progress on a core fix that won't require a workaround.

You can use "Natural Scrolling" to have a system wide inverse scrolling.

What is Natural Scrolling?

Natural Scrolling is a GNOME Applet allowing you to reverse the direction of scrolling. You push your fingers upwards to move the page content upwards (and downwards for downwards) just like on iOS devices. Don't move scrollbars anymore but your file.

Install Natural Scrolling:

Natural Scrolling can be installed from its PPA.

Hit Alt+Ctrl+T to open terminal and run following commands:

sudo add-apt-repository ppa:zedtux/naturalscrolling
sudo apt-get update
sudo apt-get install naturalscrolling

How to enable Natural Scrolling?

Once installed, Hit Super key (Windows key) to open Unity dash and search for "natural scrolling" and open it. You'll see a new indicator in Unity panel, Click on it and select your device. In the preferences you can set it to start at login. That's it!

enter image description here

share|improve this answer
Is it possible to hide the icon? – Steven Roose Jul 31 '12 at 16:09
It didn't work on system windows such as nautilus and USC. – Nur Apr 26 '13 at 7:40
Did not work for me on Fedora. The answer by Pyle actually works under all circumstances (terminal, eclipse, etc.). See – robert Jun 11 at 13:35

The Natural Scrolling application referred to in Basharat Sial's answer does not fix natural scrolling in certain system windows.

As an alternative, I recommend the guide provided in this answer. You won't need the natural scrolling application anymore when you use his guide.

share|improve this answer

You can also use Ubuntu Tweak tool to enable natural scrolling (misc settings)


Official homepage with .deb distributive:

share|improve this answer
I can confirm that this worked on 14.10. For some reason, I was unable to install the naturalscrollingpackage (W: Failed to fetch… 404 Not Found) – BoD Nov 20 '14 at 14:07

In newer versions of GNOME (starting from at least 3.6), installing an extension is no longer required. It can be found under the standard GNOME "Mouse and Touchpad"-settings. Somewhat confusingly however, the Gnomesters decided to call it "Content sticks to fingers".

share|improve this answer

There are several ways to enable system-wide inverse or natural scrolling for the mouse. Only two ways I have tried will enable it for all windows, including gedit, terminal, software center, nautilus, and others. The easiest way to do it is to do the following. This method will need the latest version of the xserver-xorg-input-evdev driver, which you can get from here. I know it will work because I am using it and tested it previous to writing this version of a guide I previously wrote for Fedora 21. Make sure that you have reverse scrolling turned off in Ubuntu-Tweak, or you won't see the effect of the changes. In addition, for those users who do not want to use natural scrolling on your system now that reverse scrolling will be system-wide, those users can use this option to turn off natural scrolling on a per user basis. Now, to get started...

Update/install Evdev to latest version and reboot before continuing this guide.

Get your mouse device id by running the following in a terminal:

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"

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 (272) 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 the alternate way shown below this guide.

Run the following command in your open terminal:

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

Now, run 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 I put -1):

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

Save the file and exit 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

You might need to quit nautilus and restart nautilus on some systems (skip this if natural scrolling is working in nautilus after running the above command). Press Alt+F2 and run each of these commands separately:

nautilus -q

nautilus -n

That's it! You should now have system-wide natural scrolling that will be persistent.

Alternate method:

If you do not want to install the latest version of Evdev (or, if your mouse doesn't have the "Scrolling Distance" property even in the latest Evdev), you can do the following:

Run the following command in your open terminal:

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

Now, run 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:

Section "InputClass"
        Identifier "natural scrolling for mouse wheel"
        MatchIsPointer "on"
        MatchDevicePath "/dev/input/event*"
        Driver "mouse"
        Option "Device" "/dev/input/mice"
        Option "Protocol" "Auto"
        Option "ZAxisMapping" "5 4"

Save the file and reboot. As above, individual users can switch it off on a per-user basis by using Ubuntu-Tweak to "turn on" natural scrolling (it will be the reverse of the system-wide setting on a per-user basis but will not affect the actual system setting for other users who will want to use natural scrolling).

Note: The alternative method here will not work if you have the latest Evdev installed, such as in Fedora 22. Use the Evdev method above. Also note: Neither method will work with libinput in Wayland. You will need an alternative way of doing it per user or otherwise. If using libinput, make sure to remove the files created as above, and create a startup item in a desktop file. After creating the desktop file, place the following in the Exec line (be sure to use the device id for your mouse and the naturalscrolling property number for your mouse while using libinput; my device id was 11 and the property was 272; adjust yours accordingly).

sh -c "sleep 5; exec xinput set-prop 11 272 1"

Following that, save the file and logoff. When you logon again you should have natural scrolling on a per-user basis or may be able to set it in the autostart for all users.

share|improve this answer
Perfect! I did not have to use the alternative method. Lenovo Helix, Arch Linux, Gnome 3.16 and Logitech MX wireless mouse. THANK YOU! – eduncan911 Apr 30 at 19:38
Thank you! For other users (with multiple keyboards like me)... the part about xinput set-prop etc. in this answer is only necessary to avoid reboot. – robert Jun 11 at 13:34
The 'alternate method' without evdev did not work for me on Fedora 22 and made the mouse pointer unresponsive (failed to load mouse module). – robert Jun 11 at 13:40
Yes, I found that the alternative method no longer works with Fedora 22 and above. You get to choose between Evdev or libinput. If you install the Evdev driver, please do not use the alternative method. It won't work. With Fedora 22 you get one of the latest versions of Evdev anyway so the alternative method is a moot point in that version although it still works in other distributions until the newest changes become incorporated in them. I recommend Evdev rather than libinput. Libinput still is very buggy and will not work with either method here. – D. Charles Pyle Jun 12 at 21:43
First method works like a charm. Ubuntu 15.4 and Microsoft Touch Mouse. Thanks! – konstantin.zaikin Sep 1 at 7:49

Please follow below steps to system widely change the scrolling.

  1. On Terminal write: xev -event mouse. You will get one small box and when you bring your mouse into that section you will get a lot data getting generated into the Terminal.
  2. On scrolling up, note the button name, lets say "x" (in my case it is button 5). Also note down the button name on scrolling down, lets say "y". in my case it is "4".
  3. Create a backup of ~/.Xmodmap file by using cp ~/.Xmodmap ~/.Xmodmap.bak.
  4. Do cat ~/.Xmodmap. Output would be like pointer = 1 2 3 5 4 6 7 8 9 10 11 12
  5. In the above output search for x and y and they will be in consecutive position and just swap them. In my case echo "pointer = 1 2 3 4 5 6 7 8 9 10 11 12" > ~/.Xmodmap && xmodmap ~/.Xmodmap worked. Note switch of 4 and 5.
  6. Now the scrolling will be applied system wide. No need to reboot.
share|improve this answer

OK, so I had Firefox scrolling one way and Evolution scrolling the other. I set natural scrolling under System settings, but find that Ubuntu tweak natural scrolling counteracts it in certain apps. I have to have both system settings AND Ubuntu tweak set to natural scrolling to get universal scroll in the same direction, otherwise they seem to fight each other. It took me many hours to figure this out.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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