Monday, February 25, 2013

Touchpad tweaks


[I've given this a general title because I'm probably going to add stuff in here with time]

Linux is customizable, and that is kinda awesome in a day and age where technology has become so advanced it can and is being "dumbed down."

This post is going to give you an easy way to enable a feature that while being -in my opinion- amazing in its simplicity makes messing around on your laptop a lot more satisfying.

Circular scrolling.

You probably got the gist of what it is from the name, you move your finger in a circular motion to scroll stuff up and down.
To me the old way of scrolling on the side of the touchpad was horrible, the dual-finger scroll improved on the concept, but laziness breeds laziness and the constant lifting of your finger(s) becomes a tedious task.
With circular scrolling you don't have that, and to be fair to Apple, they were smart to adopt the concept to their iPods.

It's an easy setup.
You'll need the gsynaptics package and its dependencies.
[EDIT MAY 5TH: Head further down for an updated approach to enable circular scrolling]

Open a terminal and type in

sudo apt-get install -y gsynaptics

When it's done, either open it by looking for it in the app launcher (search for "gpoint" if you want an easy time finding it) or in terminal type:

gpointing-device-settings

You'll have a window displaying pointing devices in the left pane and four tabs.
Make sure the touchpad is selected and in the General tab uncheck "Disable tapping and scrolling" if it's checked, it is by default for me.
Head to the Scrolling tab and check the "Enable Circular scrolling" box, then proceed to choose where on the pad you want to initiate scrolling.
I personally choose the mid-top position.

You might also want to check the bottom-most box for horizontal scrolling.

You're done, check it, love it, love life.

I've had the settings not being persistent though reboot on earlier versions of Ubuntu (I am currently running 12.10), if this is the case for you there will soon be an addition here showing how to set these settings on boot witha few simple commands.

[May 5th update]
Running a newer version of Ubuntu (and possily other distros), follow these very simple instructions to make permanent changes to how your touchpad works.

First, you need to find out which device your touchpad actually is, to do this open a terminal and type in the following command:
xinput list
 You will be presented with an output similar to this:

⎡ Virtual core pointer                     id=2 [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer               id=4 [slave  pointer  (2)]
⎜   ↳ ETPS/2 Elantech Touchpad                 id=12 [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)]
    ↳ Video Bus                               id=7 [slave  keyboard (3)]
    ↳ Sleep Button                             id=8 [slave  keyboard (3)]
    ↳ ASUS USB2.0 Webcam                       id=9 [slave  keyboard (3)]
    ↳ Asus WMI hotkeys                         id=10 [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard             id=11 [slave  keyboard (3)]

The entry you will want to use later is your equivalent to my "ETPS/2 Elantech Touchpad"
Now, in your terminal once again type in the following two commands:

xinput set-prop "yourdevicehere" --type=int "Synaptics Circular Scrolling" 1
xinput set-prop "yourdevicehere" --type=int "Synaptics Circular Scrolling Trigger" 1
You now have circular scrolling enabled for the duration of your session, now to make that permanent.
You'll need a .sh file, my editor of choice is nano but use whatever you'd like, yet again in terminal type in:
nano ~/.config/TouchpadSettings.sh
You're now inside the/an editor, add these three lines to your document:
#!/bin/sh
xinput set-prop "yourdevicehere" --type=int "Synaptics Circular Scrolling" 1
xinput set-prop "yourdevicehere" --type=int "Synaptics Circular Scrolling Trigger" 1
Save the file by pressing [CTRL+X] > [Y] > [ENTER]
Your file is now created, there are two more steps and you're done. In the terminal for the last time, type in this command:
sudo chmod +x ~/.config/TouchpadSettings.sh
Your file is now made executable, and all that remains is finding startup applications and adding the file there. Startup applications you'll find the way you find any other installed program, depending on whether you're running Unity, Gnome, or whatever.

Note: The trigger can be set from 0 to 8, and they control from where your circular scrolling gesture should be triggered.
0 All Edges                       1 Top Edge
2 Top Right Corner          3 Right Edge
4 Bottom Right Corner     5 Bottom Edge
6 Bottom Left Corner       7 Left Edge
8 Top Left Corner

Should you wish to mess around with other touchpad settings, do a google search for "synaptics options" or similar, and you will find plenty of lists and descriptions of what various options do, but keep in mind you have some basic touchpad settings native in Ubuntu and won't need to set everything manually.