<?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>Stijn D&#039;haese &#187; Ubuntu</title>
	<atom:link href="http://blog.stijn-dhaese.be/category/ubuntu/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.stijn-dhaese.be</link>
	<description>This is the personal blog of Stijn D&#039;haese. A little freedom on the net by an analyst, developer and system administrator from Belgium.</description>
	<lastBuildDate>Fri, 23 Dec 2011 18:44:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Using the Thinkvantage key under Ubuntu (8.10)</title>
		<link>http://blog.stijn-dhaese.be/2008/12/using-the-thinkvantage-key-under-ubuntu-810/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=using-the-thinkvantage-key-under-ubuntu-810</link>
		<comments>http://blog.stijn-dhaese.be/2008/12/using-the-thinkvantage-key-under-ubuntu-810/#comments</comments>
		<pubDate>Mon, 22 Dec 2008 10:45:56 +0000</pubDate>
		<dc:creator>Stijn</dc:creator>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Access IBM]]></category>
		<category><![CDATA[Blue button]]></category>
		<category><![CDATA[ThinkPad button]]></category>
		<category><![CDATA[Thinkpad R60]]></category>
		<category><![CDATA[Ubuntu 9.04 Jaunty Jackalope]]></category>
		<category><![CDATA[Ubuntu Intrepid Ibex (8.10)]]></category>

		<guid isPermaLink="false">http://www.stijn-dhaese.be/blog/?p=49</guid>
		<description><![CDATA[A few weeks ago I found a way to assign the Thinkvantage key from my Thinkpad R60 to open a terminal under Ubuntu Intrepid Ibex (8.10). Because most documentation is outdated, I will place and share a little tutorial with you. I will go to all the steps, even those who might be useless for [...]]]></description>
			<content:encoded><![CDATA[<p class="intro">A few weeks ago I found a way to assign the Thinkvantage key from my Thinkpad R60 to open a terminal under Ubuntu Intrepid Ibex (8.10). Because most documentation is outdated, I will place and share a little tutorial with you. I will go to all the steps, even those who might be useless for some, just to make sure that everything is correct.<br />
<strong>About Ubuntu 9.04 (Jaunty Jackalope): I don&#8217;t know if this works in 9.04, but I&#8217;m planning a clean install real soon (I talking about 2 &#8211; 3 days). You always can subscribe to my <a href="http://feeds.feedburner.com/StijnDhaese">RSS-feed</a> to get notification.</strong>
</p>
<p><span id="more-49"></span></p>
<ol>
<li>Let&#8217;s open a terminal and run: <code>acpi_listen</code><br />
Then hit the ThinkVantage key. In my case it generated an &#8220;ibm/hotkey HKEY 00000080 00001018&#8243; event.</li>
<li>In the &#8220;/etc/acpi/events/&#8221;-folder you will find the file: thinkpad-thinkpad.<br />
Open it in an editor and you will see something like:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># ThinkVantage/ThinkPad/Blue button</span>
<span style="color: #007800;">event</span>=ibm<span style="color: #000000; font-weight: bold;">/</span>hotkey HKEY 00000080 00001018
<span style="color: #007800;">action</span>=<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>acpi<span style="color: #000000; font-weight: bold;">/</span>thinkpad-thinkpad.sh</pre></div></div>

</li>
<li>See the file /etc/acpi/thinkpad-thinkpad.sh in the script? Go to the folder and open it.<br />
In my file I had:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">test</span> <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>acpi-support<span style="color: #000000; font-weight: bold;">/</span>key-constants <span style="color: #000000; font-weight: bold;">||</span> <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span>
&nbsp;
. <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>acpi-support<span style="color: #000000; font-weight: bold;">/</span>key-constants
acpi_fakekey <span style="color: #007800;">$KEY_PROG1</span></pre></div></div>

<p>But for some reason this didn&#8217;t work and I changed <strong>$KEY_PROG1</strong> to <strong>$KEY_MACRO</strong>, getting:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">test</span> <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>acpi-support<span style="color: #000000; font-weight: bold;">/</span>key-constants <span style="color: #000000; font-weight: bold;">||</span> <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span>
&nbsp;
. <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>acpi-support<span style="color: #000000; font-weight: bold;">/</span>key-constants
acpi_fakekey <span style="color: #007800;">$KEY_MACRO</span></pre></div></div>

</li>
<li>Save the file and restart acpid by running the following command in your terminal: <code>sudo /etc/init.d/acpid restart</code></li>
<li>Now it&#8217;s time to check our success, run <code>xev</code> in your terminal and you will get a little window next to your terminal, ignore the terminal for now and click on the little square, then hit the ThinkVantage button and look at the terminal. You will see 2 events, something similar to:
<pre lang="">KeyPress event, serial 30, synthetic NO, window 0x2800001,
    root 0x6a, subw 0x0, time 2000522842, (138,83), root:(781,500),
    state 0x0, keycode 120 (keysym 0x0, NoSymbol), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyRelease event, serial 30, synthetic NO, window 0x2800001,
    root 0x6a, subw 0x0, time 2000522842, (138,83), root:(781,500),
    state 0x0, keycode 120 (keysym 0x0, NoSymbol), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False</pre>
<p>Really important is &#8220;<strong>keycode 120 (keysym 0&#215;0, NoSymbol)</strong>&#8220;, write down the keycode (in my case 120) and close the window.</li>
<li>Open a new terminal or go to you home folder (in your terminal) and execute the following command:  xmodmap -pke &gt; xmodmap.conf</li>
<li>Open the file and add XF86LaunchA to your corresponding keycode (in my case 120), giving you:<br />
<code>keycode 120 = XF86LaunchA</code></p>
<p><strong>Note:</strong> XF86LaunchA, is a keysyms so you can&#8217;t just place something here, you can look up the keysyms in /usr/share/X11/XKeysymDB. I used XF86LaunchA but if you would like to use the ThinkVantage button to do something different you could assign a different keysym. Example, you want to open the default webrowser, then you are better of with XF86WWW.</li>
<li>Let&#8217;s assign this map to the keyboard with the command:<code>xmodmap xmodmap.conf</code></li>
<li>Again start xev (like in step 5). This time you need to get something like: &#8220;<code>keycode 120 (keysym 0x1008ff4a, XF86LaunchA)</code>&#8220;</li>
<li>This means <strong>success</strong> but first we want to load xmodmap.conf when Ubuntu starts. To do this, enter the following commands in the terminal:
<pre lang="">sudo cp xmodmap.conf /etc/xmodmap.conf
cd /etc/gdm/PostLogin
sudo cp Default.sample Default
sudo gedit Default</pre>
<p>Now add to the file: <code>xmodmap /etc/xmodmap.conf</code><br />
And save.</p>
<p>The first time you will start (or restart) your system, ubuntu will ask to load the file. Offcource, we want to do this so select the file and load it. If you want, you may remove the xmodmap.conf in your <strong>home folder</strong> at this point.</li>
<li>Last thing to do is to assign the key to the terminal in System &gt;Preferences &gt; Keyboard Shortcuts.<br />
And&#8230; <strong>SUCCES</strong></li>
</ol>

<a href='http://blog.stijn-dhaese.be/2008/12/using-the-thinkvantage-key-under-ubuntu-810/xev/' title='Xev example in Ubuntu'><img width="150" height="150" src="http://blog.stijn-dhaese.be/wp-content/uploads/2008/12/xev-150x150.gif" class="attachment-thumbnail" alt="Xev example in Ubuntu" title="Xev example in Ubuntu" /></a>
<a href='http://blog.stijn-dhaese.be/2008/12/using-the-thinkvantage-key-under-ubuntu-810/load/' title='First time startup'><img width="150" height="150" src="http://blog.stijn-dhaese.be/wp-content/uploads/2008/12/load-150x150.gif" class="attachment-thumbnail" alt="First time startup" title="First time startup" /></a>
<a href='http://blog.stijn-dhaese.be/2008/12/using-the-thinkvantage-key-under-ubuntu-810/keyshortcut/' title='Keyboard shortcut assignment'><img width="150" height="150" src="http://blog.stijn-dhaese.be/wp-content/uploads/2008/12/keyshortcut-150x150.gif" class="attachment-thumbnail" alt="Keyboard shortcut assignment" title="Keyboard shortcut assignment" /></a>

<p>I hope this tutorial could be of some help. Please leave a comment if you have a suggestion or a problem or just want to say thank you. In the future I will try to update this version to the last release of Ubuntu as soon as I installed it. If you would use this tutorial for commercial use, like placing it in a magazine (online and offline) or book, please donate a small fee.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stijn-dhaese.be/2008/12/using-the-thinkvantage-key-under-ubuntu-810/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

