Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I've enabled natural scrolling via Ubuntu Tweak's miscellaneous options, but that doesn't seem to take effect for horizontal scroll; neither in web browsers, nor in nautilus or other native applications.

Is there a way to enforce this behavior on horizontal scrolling as well?

share|improve this question
add comment

2 Answers

up vote 7 down vote accepted

Instead of using a designated application to configure natural scrolling, a script can be made to reverse the scrolling directions - both on the vertical and the horizontal axis.

  1. First, obtain the xinput prop related to the scrolling distance (note the variables wrapped in angle brackets):

    $ xinput list
    ⎡ Virtual core pointer id=2 [master pointer (3)]
    ⎜   ↳ Virtual core XTEST pointer id=4   [slave pointer (2)]
    ⎜   ↳ SynPS/2 Synaptics TouchPad id=<TOUCHPAD_ID>   [slave pointer (2)]
    ⎣ Virtual core keyboard id=3    [master keyboard (2)]
        (...)
    
  2. Fetch the appropriate values for that prop:

    $ xinput list-props <TOUCHPAD_ID> | grep "Scrolling Distance"
        Synaptics Scrolling Distance (<DISTANCE_KEY>):  <V_DISTANCE>, <H_DISTANCE>
        Synaptics Circular Scrolling Distance (301):    0.100000
    
  3. Than, create the script file to apply the reversed directions, by negating the values for vertical / horizontal distance. Feed the variables returned earlier:

    #!/bin/sh
    xinput set-prop <TOUCHPAD_ID> <DISTANCE_KEY> -<V_DISTANCE> -<H_DISTANCE>
    nautilus -q
    nautilus -n &
    
  4. Grant the file with execution permissions, set it to run at startup, and there you have it.

Source:

This method was ported from Andy C.'s old web blog, to create a self contained answer. Thank you, Andy, for providing an elegant, system wide solution.

Update

It seems that calling nautilus is breaking the script on 13.04. Omitting the two calls to nautilus solves it.

share|improve this answer
add comment

As an alternative to using script files or Ubuntu Tweak, you can also try the app called "Natural Scrolling", made by Zedtux. It will come as an indicator.

To install it, the easiest way is using a terminal:

sudo apt-add-repository ppa:zedtux/naturalscrolling
sudo apt-get update
sudo apt-get install naturalscrolling
share|improve this answer
    
i'm aware of that. it seems, however, to fail the task for some native applications. plus, it seem redundant to install an application (and clutter up the panel with yet another indicator) solely for that purpose, while a four-liner script can resolve this, possibly better. thanks for the alternative anyhow. –  Eliran Malka Oct 20 '12 at 3:55
1  
Interesting that your script works for any window ! I indeed have a bug with this. I'll have a try with your solution. –  Agmenor Oct 20 '12 at 7:34
add comment

Your Answer

 
discard

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.