Saturday, February 14, 2009

Setting "SHMConfig" to "true" for synclient to work in recent Linux distros

Situation:
==========

1. You use a synaptics touchpad on your laptop/netbook.

2. You use a recent Linux distro (like Fedora 10) that comes with a
blank /etc/X11/xorg.conf.

3. You don't like the way your distro has configured your touchpad by
default. For example, you would like to get a middle click by
tapping the upper right corner of the touchpad.

Solution:
=========

To change the synaptics touchpad options at runtime (i.e. while the X
Server is running), you need to use the command line program
"synclient" (or graphical programs like gsynaptics, etc.).

I prefer the command line "synclient" because it allows me to tweak a
lot of things that gsynaptics does not allow me to.

For example, to get a middle click by tapping the upper right corner
of your touchpad, run synclient with the following option:

synclient TapButton2=2 RTCornerButton=2

Read the synclient manual page for more details. Do a 'synclient -l'
to get the current user settings.

In Ubuntu 8.10, synclient is provided by the package
xserver-xorg-input-synaptics.

In Fedora 10, synclient is provided by the package
xorg-x11-drv-synaptics.

But to get synclient working, you need to have the option "SHMConfig"
set as "true" in your options to Xorg. This was earlier done by adding
the line:

Option "SHMConfig" "on"

in your /etc/X11/xorg.conf file in the Synaptics InputDevice section.
Now that this file is being deprecated, you need to find out how you
can provide this option to Xorg. If you are on Fedora 10 like me
(maybe this is also the case in Ubuntu 8.10, Fedora 9, etc.), you can
put this option in a hal configuration file in /etc/hal/fdi/policy/

Using root privileges, create a file named say, synaptics.fdi, in
/etc/hal/fdi/policy/ using your favorite editor, and put the following
there:


<?xml version="1.0" encoding="ISO-8859-1"?>
<deviceinfo version="0.2">
<device>
<match key="info.capabilities" contains="input.touchpad">
<match key="info.product" contains="Synaptics TouchPad">
<merge key="input.x11_options.SHMConfig" type="string">true</merge>
</match>
</match>
</device>
</deviceinfo>


Next, restart by using the command (as root):

/etc/init.d/haldaemon restart

(The above command is for Fedora users. Use hal instead of haldaemon
if you are on Ubuntu)

Next, restart X Server using the command:

killall -HUP Xorg

Once X Server restarts, you should be able to use synclient without
any problems.

For more information regarding Synaptics Touchpad configuration
and configuring other devices under Xorg, see
http://wiki.ubuntu.com/X/Config/Input
Post a Comment