The one-line method of getting natural scrolling in Linux

Update, September 2016:
This should pretty much always work with standard mice (well, either that or I’m seriously out of touch). It will generally not work with properly configured touchpads. See this post if you’re using a touchpad.

Nowadays, this is what I run right after installing Linux systems:

echo "pointer = 1 2 3 5 4 7 6 8 9 10 11 12" > ~/.Xmodmap && xmodmap ~/.Xmodmap

No reboot required. Don’t like it? Use this to revert:

echo "pointer = 1 2 3 4 5 6 7 8 9 10 11 12" > ~/.Xmodmap && xmodmap ~/.Xmodmap

Xmodmap basically lets you remap keys, where “keys” is defined as “pretty much any hardware trigger you interact with, including everything in your mouse”. The first snippet above switches the two vertical (4 and 5) and horizontal (6 and 7) scroll keys, whereas the second puts them in their rightful order.

This entry was posted in Linux and tagged , . Bookmark the permalink.

15 Responses to The one-line method of getting natural scrolling in Linux

  1. Pingback: Fixing natural scrolling on the Macbook Air | Noyau d'Olive

  2. Pingback: EpixStudios

  3. adamt19 says:

    No command “xdomap” found? (ubuntu 12.04)

  4. Rico says:

    Ehm, this weekend in Installed OpenSUSE 12.2 and I entered the line for the natural scrolling, but now all normal apps work but all system apps, like Yast and even Wine still have normal scrolling. I also did this on my previous install, OpenSUSE 12.1 and it worked fine :s

  5. plokin says:

    Thank you, works nicely.
    Two minor things to add:
    – since you’re using ~/ to enable this solution to work whatever folder the user is in, you should also use it in “xmodmap ~/.Xmodmap”
    – to revert one has to swap not only 5 with 4, but also 7 with 6, as horizontal scrolling is affected too

  6. Rico says:

    Thanks for this tip!

  7. Pingback: Fixing natural scrolling in Ubuntu 12.04 « Andy C.'s weblog

  8. Sandy says:

    Great tip. Thanks a lot.

  9. Pingback: RĂ©mitaines : Utiliser le natural scrolling sous Linux.

  10. echo “pointer = 1 2 3 5 4 7 6 9 8 10 11 12” > ~/.Xmodmap && xmodmap .Xmodmap

    It reverses the horizontal movement too (I also changed the 8 and 9).

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s