Toggle touchpad on Ubuntu 16.04

ubuntu_logo_81x81Laptops with larger touchpad area pose a serious problem with typing. While we explored a way to reduce the effective touchpad area, sometimes turning off the touchpad is a better solution. The 14.04 way of setting synclient TouchpadOff to 0 or 1 doesn’t work on 16.04. So here’s a fresh technique with a little bit of scripting. Continue reading Toggle touchpad on Ubuntu 16.04

Reduce effective area of touchpad on Linux

cool_penguin_smallHaving a large laptop touchpad poses severe threat to typing. My touchpad is quite sensitive and whenever the lower areas of my palm touch the touchpad the pointer moves away. While the brilliant engineers at Sony designed this, it is counter-productive. And moving around with a mouse (when you have a touchpad) doesn’t see like a bright idea to me.

This morning I was quite determined to fix the problem, even if it needs a hook in the driver. Turned out if your touchpad uses the Synaptics driver, you can reduce its effective area easily. There is a userspace utility to change the parameters at runtime.

Get the default x and y axis range for your touchpad:

$ less /var/log/Xorg.0.log | grep -i range
[ 20.616] (--) synaptics: SynPS/2 Synaptics TouchPad: x-axis range 1472 - 5638 (res 37)
[ 20.616] (--) synaptics: SynPS/2 Synaptics TouchPad: y-axis range 1408 - 4714 (res 59)

As you can see from the results, for me the width is 5638 and height is 4714.

I adjust these as below:

$ synclient AreaRightEdge=5000 AreaLeftEdge=2000 AreaBottomEdge=4000

The arguments are self-explanatory. If you want to adjust the upper limit, use AreaTopEdge.

Enable two finger scrolling for a better experience.

Toggle Sony VAIO touchpad on Ubuntu 14.04

ubuntu_logo_81x81In case the older method to toggle (alternate enable disable) the touchpad is not working on Ubuntu Trusty (didn’t work for me), use the following modified script and add a keybind or keyboard shortcut to execute the script:

SYNSTATE=$(synclient -l|grep TouchpadOff|cut -d = -f2)
if [ $SYNSTATE = 0 ]; then synclient TouchpadOff=1
else synclient TouchpadOff=0

Configure touchpad activity while typing on Ubuntu

ubuntu_logo_81x81How many times has it happened that you are working without a mouse and touching the touchpad inadvertently has disturbed your typing? That happens often with me. I was looking for a way to increase the time of touchpad polling since the last key press and I found the command syndaemon which can do that. You can use it to configure the delay for which the touchpad will be disabled. Usage:

synademon -i 1 -d //where 1 is the delay in seconds

Sony VAIO SVS13112ENB touchpad on Ubuntu

ubuntu_logo_81x81By default the <Fn-F1> key combination to toggle touchpad doesn’t work on SVS13112ENB. To use an alternative key combination do the following:

1. Run xinput:

$ xinput
⎡ Virtual core pointer                    	id=2	[master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer              	id=4	[slave  pointer  (2)]
⎜   ↳ PixArt USB Optical Mouse                	id=9	[slave  pointer  (2)]
⎜   ↳ SynPS/2 Synaptics TouchPad              	id=11	[slave  pointer  (2)]
⎣ Virtual core keyboard                   	id=3	[master keyboard (2)]
    ↳ Virtual core XTEST keyboard             	id=5	[slave  keyboard (3)]
    ↳ Video Bus                               	id=6	[slave  keyboard (3)]
    ↳ Sony Vaio Keys                          	id=7	[slave  keyboard (3)]
    ↳ Power Button                            	id=8	[slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard            	id=10	[slave  keyboard (3)]

2. Add the following to a script (copy the full text below to any text editor to see it fully):

SYNSTATE=$(xinput list-props "SynPS/2 Synaptics TouchPad" | grep Enabled | grep -Eo '.$')
if [ $SYNSTATE = 0 ]; then
    xinput set-int-prop "SynPS/2 Synaptics TouchPad" "Device Enabled" 8 1
    xinput set-int-prop "SynPS/2 Synaptics TouchPad" "Device Enabled" 8 0

3. Assign a keyboard shortcut to execute the script whenever needed.

Ubuntu 13.04 adds two finger scroll

ubuntu_logo_81x81If you are tired of scrolling using your laptop’s touchpad with one finger Ubuntu Raring has introduced the option for you to scroll easily using two fingers. Navigate to

System Settings ▸ Mouse & Touchpad ▸ Two finger scroll and enable the option.

Click on the Test Your Settings button on the upper right corner of the same window and you’ll be in for a surprise! 😉

Random Ubuntu tips

ubuntu_logo_81x81Here’s a list of common tweaks I apply on Ubuntu to handle brightness, save power, disable ipv6 etc.

  1. To save power add the following in a script and add at startup:
    $ sudo echo 1500 > /proc/sys/vm/dirty_writeback_centisecs
    $ sudo echo 5 > /proc/sys/vm/laptop_mode
    $ sudo hal-disable-polling --device /dev/scd0
    $ gconftool-2 --set --type boolean /desktop/gnome/peripherals/touchpad/touchpad_enabled true
    $ xmodmap -e "clear Lock"
  2. To set brightness in Ubuntu at login:
    $ sudo setpci -s 00:02.0 F4.B=50
  3. To enable brightness key in Acer laptops add in GRUB params*:
  4. To enable Touchpad lock in Acer laptops add in GRUB params*:
  5. To disable ipv6 at boot:
  6. To re-enable Touchpad after sleep in laptop:
    $ gconftool-2 --set --type boolean \
    /desktop/gnome/peripherals/touchpad/touchpad_enabled true

* To modify GRUB boot params, open the file /etc/default/grub as sudoer and change the list of params in the line starting with