<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>BigSmoke &#187; Synaptics</title>
	<atom:link href="http://blog.bigsmoke.us/tag/synaptics/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.bigsmoke.us</link>
	<description>Smokes your problems, coughs fresh air.</description>
	<lastBuildDate>Sat, 04 Feb 2012 18:03:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Configuring X input devices through HAL</title>
		<link>http://blog.bigsmoke.us/2009/09/20/x-input-hal</link>
		<comments>http://blog.bigsmoke.us/2009/09/20/x-input-hal#comments</comments>
		<pubDate>Sun, 20 Sep 2009 13:12:15 +0000</pubDate>
		<dc:creator>Rowan Rodrik</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[HAL]]></category>
		<category><![CDATA[Synaptics]]></category>
		<category><![CDATA[Touchpad]]></category>
		<category><![CDATA[X]]></category>

		<guid isPermaLink="false">http://blog.bigsmoke.us/?p=734</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p>When I went from X.org &lt; 7.3 to X.org &gt; 7.3, I had to make some changes to my X input configuration.</p>

<p>First of all, I had to replace <tt>x11-drivers/synaptics</tt> (<tt><a href="http://web.telia.com/~u89404340/touchpad/">http://web.telia.com/~u89404340/touchpad/</a></tt>) with the newer <tt>x11-drivers/xf86-input-synaptics</tt>, which is automatically installed if you set <tt>INPUT_DEVICES="${INPUT_DEVICES} synaptics"</tt> or if you add &#8220;<tt>x11-base/xorg-server input_devices_synaptics</tt>&#8221; to <tt>/etc/portage/package.use</tt>.

<p>Starting with X.org 7.3, you&#8217;re supposed to use HAL for all the X input configuration. All the <tt>"InputDevice"</tt> sections have to be removed from <tt>xorg.conf</tt> (and of course the references in <tt>"ServerLayout"</tt>). If you don&#8217;t want this, you can add the following options:</p>

<pre class="php">Section <span style="color: #ff0000;">&quot;ServerFlags&quot;</span>
  Option <span style="color: #ff0000;">&quot;AllowEmptyInput&quot;</span> <span style="color: #ff0000;">&quot;off&quot;</span>
  Option <span style="color: #ff0000;">&quot;AutoEnableDevices&quot;</span> <span style="color: #ff0000;">&quot;off&quot;</span>
EndSection</pre>

<p>I chose HAL. I wanted to replicate the following settings using HAL.</p>

<pre class="php">Section <span style="color: #ff0000;">&quot;InputDevice&quot;</span>
    Identifier <span style="color: #ff0000;">&quot;Keyboard1&quot;</span>
    Driver     <span style="color: #ff0000;">&quot;kbd&quot;</span>
    Option <span style="color: #ff0000;">&quot;AutoRepeat&quot;</span> <span style="color: #ff0000;">&quot;500 30&quot;</span>
    Option <span style="color: #ff0000;">&quot;XkbRules&quot;</span>  <span style="color: #ff0000;">&quot;xorg&quot;</span>
    Option <span style="color: #ff0000;">&quot;XkbModel&quot;</span>  <span style="color: #ff0000;">&quot;thinkpadintl&quot;</span>
    Option <span style="color: #ff0000;">&quot;XkbLayout&quot;</span> <span style="color: #ff0000;">&quot;us&quot;</span>
    Option <span style="color: #ff0000;">&quot;XkbOptions&quot;</span>        <span style="color: #ff0000;">&quot;ctrl:nocaps,altwin:menu,compose:ralt,eurosign:e&quot;</span>
EndSection
&nbsp;
Section <span style="color: #ff0000;">&quot;InputDevice&quot;</span>
    Identifier <span style="color: #ff0000;">&quot;Synaptics Touchpad&quot;</span>
    Driver     <span style="color: #ff0000;">&quot;synaptics&quot;</span>
    Option <span style="color: #ff0000;">&quot;SendCoreEvents&quot;</span> <span style="color: #ff0000;">&quot;true&quot;</span>
    Option <span style="color: #ff0000;">&quot;Device&quot;</span> <span style="color: #ff0000;">&quot;/etc/psaux&quot;</span>
    Option <span style="color: #ff0000;">&quot;Protocol&quot;</span>    <span style="color: #ff0000;">&quot;auto-dev&quot;</span>    <span style="color: #808080; font-style: italic;"># Auto detect</span>
<span style="color: #808080; font-style: italic;">#    Option &quot;TouchpadOff&quot; &quot;1&quot; #Uncomment if you just want to disable the touchpad and use only the trackpoint</span>
<span style="color: #808080; font-style: italic;">#    Option &quot;HorizScrollDelta&quot; &quot;0&quot; #Why is this in here by default. By Gods, it kill horizontal scrolling!</span>
    Option <span style="color: #ff0000;">&quot;RightEdge&quot;</span> <span style="color: #ff0000;">&quot;5500&quot;</span> <span style="color: #808080; font-style: italic;">#This is a little bigger than the default narrowing the scroll region</span>
    Option <span style="color: #ff0000;">&quot;BottomEdge&quot;</span> <span style="color: #ff0000;">&quot;4500&quot;</span> <span style="color: #808080; font-style: italic;">#This is a little bigger than the default narrowing the scroll region</span>
    Option <span style="color: #ff0000;">&quot;RTCornerButton&quot;</span> <span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #808080; font-style: italic;">#disable Right Top corner &quot;button&quot; </span>
    Option <span style="color: #ff0000;">&quot;RBCornerButton&quot;</span> <span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #808080; font-style: italic;">#disable Right Top corner &quot;button&quot; </span>
    Option <span style="color: #ff0000;">&quot;SHMConfig&quot;</span> <span style="color: #ff0000;">&quot;on&quot;</span> <span style="color: #808080; font-style: italic;">#this allows configuration of the touchpad using qsynaptics, synclient, or what have you</span>
EndSection</pre>

<p>The keyboard part was easy. I copied <tt>/usr/share/hal/fdi/policy/10osvendor/10-keymap.fdi</tt> to <tt>/etc/hal/fdi/policy/99-keymap.fdi</tt> and made a few adjustments:</p>

<pre class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;ISO-8859-1&quot;</span><span style="font-weight: bold; color: black;">?&gt;</span></span> <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- -*- SGML -*- --&gt;</span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;deviceinfo</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;0.2&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
  <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;device<span style="font-weight: bold; color: black;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;match</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;info.capabilities&quot;</span> <span style="color: #000066;">contains</span>=<span style="color: #ff0000;">&quot;input.keymap&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
      <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;append</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;info.callouts.add&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;strlist&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>hal-setup-keymap<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/append<span style="font-weight: bold; color: black;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/match<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;match</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;info.capabilities&quot;</span> <span style="color: #000066;">contains</span>=<span style="color: #ff0000;">&quot;input.keys&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
      <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;merge</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;input.xkb.rules&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;string&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>xorg<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/merge<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;
      <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- If we're using Linux, we use evdev by default (falling back to
           keyboard otherwise). --&gt;</span></span>
      <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;merge</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;input.xkb.model&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;string&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>thinkpadintl<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/merge<span style="font-weight: bold; color: black;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;match</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;/org/freedesktop/Hal/devices/computer:system.kernel.name&quot;</span>
             <span style="color: #000066;">string</span>=<span style="color: #ff0000;">&quot;Linux&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;merge</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;input.xkb.model&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;string&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>evdev<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/merge<span style="font-weight: bold; color: black;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/match<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;
      <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;merge</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;input.xkb.layout&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;string&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>us<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/merge<span style="font-weight: bold; color: black;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;merge</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;input.xkb.variant&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;string&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
      <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;merge</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;input.xkb.autoRepeat&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;string&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>500 30<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/merge<span style="font-weight: bold; color: black;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;merge</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;input.xkb.options&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;string&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>ctrl:nocaps,altwin:menu,compose:ralt,eurosign:e<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/merge<span style="font-weight: bold; color: black;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/match<span style="font-weight: bold; color: black;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/device<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/deviceinfo<span style="font-weight: bold; color: black;">&gt;</span></span></span></pre>

<p>The Touchpad configuration was a little more involving, because I added a few options which, before, I didn&#8217;t know the thing supported. <tt>99-x11-synaptics.fdi</tt>:</p>

<pre class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;ISO-8859-1&quot;</span><span style="font-weight: bold; color: black;">?&gt;</span></span>
&nbsp;
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;deviceinfo</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;0.2&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
  <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;device<span style="font-weight: bold; color: black;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;match</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;info.capabilities&quot;</span> <span style="color: #000066;">contains</span>=<span style="color: #ff0000;">&quot;input.touchpad&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
&nbsp;
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;merge</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;input.x11_driver&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;string&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>synaptics<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/merge<span style="font-weight: bold; color: black;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Arbitrary options can be passed to the driver using
         the input.x11_options property since xorg-server-1.5. --&gt;</span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Switch on shared memory, enables the driver to be configured at runtime --&gt;</span></span>
    <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- This allows configuration of the touchpad using qsynaptics, synclient, or what have you --&gt;</span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;merge</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;input.x11_options.SHMConfig&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;string&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>on<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/merge<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Enable vertical scrolling by dragging your finger along the right edge --&gt;</span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;merge</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;input.x11_options.VertEdgeScroll&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;string&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>1<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/merge<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Enable horizontal scrolling by dragging your finger along the left edge --&gt;</span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;merge</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;input.x11_options.HorizEdgeScroll&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;string&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>1<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/merge<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- This is a little bigger than the default narrowing the scroll region --&gt;</span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;merge</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;input.x11_options.RightEdge&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;string&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>5500<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/merge<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- This is a little bigger than the default narrowing the scroll region --&gt;</span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;merge</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;input.x11_options.BottomEdge&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;string&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>4500<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/merge<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- disable Right Top corner &quot;button&quot; --&gt;</span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;merge</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;input.x11_options.RTCornerButton&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;string&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>0<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/merge<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- disable Right Bottom corner &quot;button&quot; --&gt;</span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;merge</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;input.x11_options.RBCornerButton&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;string&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>0<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/merge<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Enable vertical scrolling when dragging with two fingers anywhere on the touchpad --&gt;</span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;merge</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;input.x11_options.VertTwoFingerScroll&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;string&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>1<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/merge<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Enable horizontal scrolling when dragging with two fingers anywhere on the touchpad --&gt;</span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;merge</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;input.x11_options.HorizTwoFingerScroll&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;string&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>1<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/merge<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Enable tapping to emulate mouse buttons --&gt;</span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;merge</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;input.x11_options.TapButton1&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;string&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>1<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/merge<span style="font-weight: bold; color: black;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;merge</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;input.x11_options.TapButton2&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;string&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>2<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/merge<span style="font-weight: bold; color: black;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;merge</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;input.x11_options.TapButton3&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;string&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>3<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/merge<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Maximum movement of the finger for detecting a tap --&gt;</span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;merge</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;input.x11_options.MaxTapMove&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;string&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>221<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/merge<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- For other possible options, check CONFIGURATION DETAILS in synaptics man page --&gt;</span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/match<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/device<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/deviceinfo<span style="font-weight: bold; color: black;">&gt;</span></span></span></pre>

<p>I&#8217;m still not completely satisfied with the Touchpad configuration (actually less so than before I started messing with HAL), so I wrote a little tool to be able to mess around with my configuration a little bit easier.</p>

<h2>Introducing <tt>synclient-sync</tt></h2>

<p>With <tt>SHMConfig on</tt>, you can use the <tt>synclient</tt> program to make changes to the touchpad configuration without having to restart X. I decided that it would be handy if I could utilize this to test out changes I made to the HAL config file without having to reload it, so I wrote a little script which detects the differences between the current (live) configuration and the configuration in the HAL <tt>.fdi</tt> file. The running configuration is then updated to reflect the changes in this file.
(Newer versions of the script can be found <a href="http://gist.github.com/169034">on GitHub</a>)</p>

<pre class="bash"><span style="color: #808080; font-style: italic;">#!/bin/bash</span>
 
<span style="color: #0000ff;">HAL_FILE=</span>/etc/hal/fdi/policy/<span style="color: #cc66cc;">99</span>-x11-synaptics.fdi
 
<span style="color: #0000ff;">VERBOSITY_LEVEL=</span><span style="color: #cc66cc;">2</span>
 
usage<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
    cat &lt;&lt;EOF
Usage: $<span style="color: #cc66cc;">0</span> options
 
OPTIONS:
--verbosity <span style="color: #66cc66;">&#91;</span>level<span style="color: #66cc66;">&#93;</span> Control the level of output processed by the script.
Level <span style="color: #cc66cc;">0</span>: No output at all
Level <span style="color: #cc66cc;">1</span>: Only output changed options
Level <span style="color: #cc66cc;">2</span>: Only output options <span style="color: #000066;">set</span> <span style="color: #b1b100;">in</span> the configuration file
Level <span style="color: #cc66cc;">3</span>: Output all options
--verbose Shortcut <span style="color: #b1b100;">for</span> verbosity level <span style="color: #cc66cc;">3</span>
--<span style="color: #000066;">help</span> Show this <span style="color: #000066;">help</span>
EOF
 
    <span style="color: #000066;">exit</span> <span style="color: #cc66cc;">1</span>
<span style="color: #66cc66;">&#125;</span>
 
options_from_hal_file<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
    <span style="color: #0000ff;">HAL_SED_FILTER=</span><span style="color: #ff0000;">'s%^<span style="color: #000099; font-weight: bold;">\s</span>*&lt;merge<span style="color: #000099; font-weight: bold;">\s</span>*key=&quot;input<span style="color: #000099; font-weight: bold;">\.</span>x11_options<span style="color: #000099; font-weight: bold;">\.</span><span style="color: #000099; font-weight: bold;">\(</span>.*<span style="color: #000099; font-weight: bold;">\?</span><span style="color: #000099; font-weight: bold;">\)</span>&quot;<span style="color: #000099; font-weight: bold;">\s</span>*type=&quot;string&quot;&gt;<span style="color: #000099; font-weight: bold;">\(</span>.*<span style="color: #000099; font-weight: bold;">\)</span>&lt;/merge&gt;%<span style="color: #000099; font-weight: bold;">\1</span>=<span style="color: #000099; font-weight: bold;">\2</span>%'</span>
    cat <span style="color: #0000ff;">$HAL_FILE</span> \
        | grep <span style="color: #ff0000;">'&lt;merge key=&quot;input.x11_options.'</span> \
        | grep -v <span style="color: #ff0000;">'SHMConfig'</span> \
        | sed -e <span style="color: #0000ff;">$HAL_SED_FILTER</span>
<span style="color: #66cc66;">&#125;</span>
 
from<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
     synclient -l \
        | grep <span style="color: #ff0000;">'='</span> \
        | sed -e <span style="color: #ff0000;">'s/<span style="color: #000099; font-weight: bold;">\s</span>//g'</span> \
        | <span style="color: #b1b100;">while</span> <span style="color: #000066;">read</span> option; <span style="color: #b1b100;">do</span>
<span style="color: #0000ff;">key=</span>`<span style="color: #000066;">echo</span> <span style="color: #0000ff;">$option</span>|cut -f <span style="color: #cc66cc;">1</span> -d <span style="color: #ff0000;">'='</span>`
            <span style="color: #0000ff;">old_val=</span>`<span style="color: #000066;">echo</span> <span style="color: #0000ff;">$option</span>|cut -f <span style="color: #cc66cc;">2</span> -d <span style="color: #ff0000;">'='</span>`
            <span style="color: #0000ff;">new_val=</span>`options_from_hal_file|grep <span style="color: #0000ff;">$key</span>|cut -f <span style="color: #cc66cc;">2</span> -d <span style="color: #ff0000;">'='</span>`
 
            <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#91;</span> -z <span style="color: #0000ff;">$new_val</span> <span style="color: #66cc66;">&#93;</span>; <span style="color: #b1b100;">then</span>
                <span style="color: #66cc66;">&#91;</span> <span style="color: #0000ff;">$VERBOSITY_LEVEL</span> == <span style="color: #cc66cc;">3</span> <span style="color: #66cc66;">&#93;</span> &amp;&amp; <span style="color: #000066;">echo</span> -e <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\e</span>[1;30m$key = $old_val<span style="color: #000099; font-weight: bold;">\e</span>[0m&quot;</span>
            <span style="color: #b1b100;">elif</span> <span style="color: #66cc66;">&#91;</span> <span style="color: #0000ff;">$old_val</span> != <span style="color: #0000ff;">$new_val</span> <span style="color: #66cc66;">&#93;</span>; <span style="color: #b1b100;">then</span>
                <span style="color: #66cc66;">&#91;</span> <span style="color: #0000ff;">$VERBOSITY_LEVEL</span> -ge <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">&#93;</span> &amp;&amp; <span style="color: #000066;">echo</span> -e <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\e</span>[1m$key = <span style="color: #000099; font-weight: bold;">\e</span>[1;31m$old_val <span style="color: #000099; font-weight: bold;">\e</span>[1;4;32m$new_val<span style="color: #000099; font-weight: bold;">\e</span>[0m&quot;</span>
                synclient <span style="color: #ff0000;">&quot;$key=$new_val&quot;</span>
            <span style="color: #b1b100;">else</span> <span style="color: #808080; font-style: italic;"># The HAL file and the life configuration are in sync</span>
                <span style="color: #66cc66;">&#91;</span> <span style="color: #0000ff;">$VERBOSITY_LEVEL</span> -ge <span style="color: #cc66cc;">2</span> <span style="color: #66cc66;">&#93;</span> &amp;&amp; <span style="color: #000066;">echo</span> -e <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\e</span>[1m$key = <span style="color: #000099; font-weight: bold;">\e</span>[4m$new_val<span style="color: #000099; font-weight: bold;">\e</span>[0m&quot;</span>
            <span style="color: #b1b100;">fi</span>
<span style="color: #b1b100;">done</span>
<span style="color: #66cc66;">&#125;</span>
 
<span style="color: #0000ff;">do_from=</span><span style="color: #cc66cc;">0</span>
<span style="color: #b1b100;">while</span> <span style="color: #66cc66;">&#91;</span> $<span style="color: #808080; font-style: italic;"># -gt 0 ]; do</span>
<span style="color: #b1b100;">case</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #b1b100;">in</span>
        --from-hal<span style="color: #66cc66;">&#41;</span>
            <span style="color: #0000ff;">do_from=</span><span style="color: #cc66cc;">1</span>
            ;;
        --verbose<span style="color: #66cc66;">&#41;</span>
            <span style="color: #0000ff;">VERBOSITY_LEVEL=</span><span style="color: #cc66cc;">3</span>
            ;;
        --verbosity<span style="color: #66cc66;">&#41;</span>
            <span style="color: #0000ff;">VERBOSITY_LEVEL=</span>$<span style="color: #cc66cc;">2</span>
            <span style="color: #000066;">shift</span>
            ;;
        --<span style="color: #000066;">help</span><span style="color: #66cc66;">&#41;</span>
            usage
            ;;
    <span style="color: #b1b100;">esac</span>
<span style="color: #000066;">shift</span>
<span style="color: #b1b100;">done</span>
 
<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#91;</span> <span style="color: #0000ff;">$do_from</span> == <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">&#93;</span>; <span style="color: #b1b100;">then</span>
from
<span style="color: #b1b100;">else</span>
usage
<span style="color: #b1b100;">fi</span>
 
<span style="color: #808080; font-style: italic;"># vim: set shiftwidth=4 tabstop=4 expandtab: </span></pre>

<h2>References</h2>

<ul>
  <li><a href="http://en.gentoo-wiki.com/wiki/Synaptics_Touchpad/Xorg_7.3">en.gentoo-wiki.com/wiki/Synaptics_Touchpad/Xorg_7.3</a></li>
</ul>]]></content:encoded>
			<wfw:commentRss>http://blog.bigsmoke.us/2009/09/20/x-input-hal/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

