<?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>blog.cnlpete.de &#187; X41t</title>
	<atom:link href="http://blog.cnlpete.de/tag/x41t/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.cnlpete.de</link>
	<description>Linux - Server - Ubuntu</description>
	<lastBuildDate>Thu, 28 Jul 2011 15:47:12 +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>X41t &#8211; Rotate screen (on Swivel Events) on 10.10</title>
		<link>http://blog.cnlpete.de/2011/02/x41t-rotate-screen-on-swivel-events-on-10-10/</link>
		<comments>http://blog.cnlpete.de/2011/02/x41t-rotate-screen-on-swivel-events-on-10-10/#comments</comments>
		<pubDate>Tue, 01 Feb 2011 12:29:18 +0000</pubDate>
		<dc:creator>cnlpete</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[10.10]]></category>
		<category><![CDATA[ACPI]]></category>
		<category><![CDATA[tablet]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[wacom]]></category>
		<category><![CDATA[X41t]]></category>

		<guid isPermaLink="false">http://blog.cnlpete.de/?p=398</guid>
		<description><![CDATA[Vor einiger Zeit habe ich schon einen Artikel diesbezüglich geschrieben: Link ... Größtenteils ist auch alles gleichgeblieben, jedoch gibt es ein paar Vereinfachungen und Verbesserungen, so dass ich mal einen neuen Artikel aufsetze. So war bei mir zum Beispiel das Paket xserver-xorg-input-wacom schon installiert und das Paket wacom-tools braucht man gar nicht mehr. Auch das [...]]]></description>
			<content:encoded><![CDATA[<p>Vor einiger Zeit habe ich schon einen Artikel diesbezüglich geschrieben: <a href="http://blog.cnlpete.de/2009/10/screen-rotat/">Link</a> ...<br />
Größtenteils ist auch alles gleichgeblieben, jedoch gibt es ein paar Vereinfachungen und Verbesserungen, so dass ich mal einen neuen Artikel aufsetze.</p>
<p><span id="more-398"></span>So war bei mir zum Beispiel das Paket <em>xserver-xorg-input-wacom</em> schon installiert und das Paket <em>wacom-tools</em> braucht man gar nicht mehr.</p>
<p>Auch das Umbenennen ist <strong>nicht</strong> mehr nötig, bei mir funktioniert das auflisten per <em>xsetwacom list</em> auch schon so:</p>
<pre>$ xsetwacom list
Serial Wacom Tablet eraser ERASER
Serial Wacom Tablet stylus STYLUS</pre>
<p>Wir sehen, dass unser gewünschtes Gerät nciht mehr nur 'stylus' heißt, sondern 'Serial Wacom Tablet stylus', müssen dies also in der gleich folgenden rotatetablet.sh eventuell anpassen.</p>
<h3>Rotatetablet.sh</h3>
<p>Um den Bildschirm nun zu drehen, gibt es ein schönes Skript von <a href="http://liken.otsoa.net/blog/index.php?entry=entry080617-120522">Liken Apuntes</a>, welches ich jedoch noch minimal angepasst habe:</p>
<pre>#!/bin/bash

#STATUS_FILE=~/.rotate-status
STATUS_FILE=/tmp/.rotate-status
STYLUS=`xsetwacom --list | grep stylus`
STYLUS=${STYLUS%\ STYLUS*}
#STYLUS='Serial Wacom Tablet stylus'
################## Compiz Prevention
function compiz_on {
   USER=`ps -ef |grep metacity |grep -v grep|awk -F" " '{print $1}'`
   #if [ "$(pidof metacity)" ]
   if [ "$USER" ]
   then
      echo 'Activating Compiz...'
      #Uncomment this if you use compiz
      #DISPLAY=":0.0" sudo -H -u $USER /usr/bin/compiz --replace &amp;
      #DISPLAY=":0.0" sudo -H -u $USER /usr/bin/emerald --replace &amp;
   fi
}

function compiz_off {
   USER=`ps -ef | grep compiz.real | grep -v grep | awk -F" " '{print $1}'`
   #if [ "$(pidof compiz.real)" ]
   if [ "$USER" ]
   then
      echo 'Compiz Active. Deactivating...'
      DISPLAY=":0.0" sudo -H -u $USER /usr/bin/metacity --replace &amp;
   fi
}
##################################################

######################## Keycodes PgUp/PgDown
function keymap() {
   USER=`who |grep tty7 |awk -F" " '{print $1}'`
   if [ "$USER" ]
   then
      case "$1" in
      1)
         echo 'Modifying xmodmap ...'
         DISPLAY=":0.0" sudo -H -u $USER xmodmap -e 'keycode 105 = Prior'
         DISPLAY=":0.0" sudo -H -u $USER xmodmap -e 'keycode 99 = Next'
         ;;
      *)
         echo 'xmodmap normal ...'
         DISPLAY=":0.0" sudo -H -u $USER xmodmap -e 'keycode 105 = Next'
         DISPLAY=":0.0" sudo -H -u $USER xmodmap -e 'keycode 99 = Prior'
         ;;
      esac
   fi
}
###############################
function rotate() {

    case "$1" in
        3|right) N=3; T=cw ; compiz_off ; keymap 0 ;;
        1|left) N=1; T=ccw ; compiz_off ; keymap 1 ;;
        2|inverted) N=2; T=half ; compiz_off; keymap 0 ;;
        0|normal) N=0; T=none ; compiz_on ; keymap 0 ;;
        *)
           echo -e "Usage:\n  $(basename $0) [left|right|inverted|normal]\n\nIf no option is given, rotates the screen 90 degrees to the right.\n";

           exit 1
           ;;
    esac

    #xrandr -o $N &amp; \

    #More secure
    if [ "`/usr/bin/xrandr -o $N -v | grep -i 'randr' | wc -l`" -ne "1" ]
    then
        echo '!! Something went wrong...'
        export DISPLAY=":0.0"
        export XAUTHORITY=/var/lib/gdm/\:0.Xauth
        #/usr/bin/xset -display $DISPLAY dpms
        echo 'Trying to unrotate again...'
        /usr/bin/xrandr -o $N &amp;
    fi

    xsetwacom set "$STYLUS" Rotate $T &amp; \
    echo $N &gt; $STATUS_FILE
}

if [ "$#" == "0" ]; then
    rotate $(((3+0$(cat $STATUS_FILE 2&gt;/dev/null))%4))
else
    rotate $1
fi</pre>
<p>Entweder ihr kopiert euch das, oder bezieht es aus meinem Gist: <a href="https://gist.github.com/805702">Link</a></p>
<p>Einfach speichern unter /usr/local/bin/rotatetablet.sh und mit <em>sudo chmod +x /usr/local/bin/rotatetablet.sh</em> ausführbar machen.</p>
<p>Nun sollte ein Aufruf von <em>rotatetablet.sh</em> beziehungsweise <em>rotatetablet.sh normal</em> schon den gewünschten dreh-effekt erzielen.</p>
<h3>swivel-up und swivel-down</h3>
<p>Vom Prinzip brauchen wir 4 Dateien, 2 Skripte die den entsprechenden rotatetablet-Aufruf tätigen (in /etc/acpid/) und 2 Event-Skripte in /etc/acpid/events, in denen die swivel-Events deklariert sind.</p>
<p>In den ersten beiden Dateien müssen die event-keys eventuell angepasst werden, herausfinden könnt ihr die event-keys durch ein einfaches</p>
<blockquote><p>acpi_listen</p></blockquote>
<p>Nun werden sämtliche Events aufgeführt, die ihr so tätigt, also einfach einmal umklappen und wieder aufrichten und ihr erhaltet eine ähnliche Ausgabe wie die folgende:</p>
<pre>ibm/hotkey HKEY 00000080 00005009
ibm/hotkey HKEY 00000080 0000500a</pre>
<p>Nun die Dateien erstellen:</p>
<blockquote><p>sudo nano /etc/acpi/events/x41t-swivel-down</p></blockquote>
<pre># /etc/acpi/events/x41t-swivel-down
# called when tablet head swivels down
event=ibm/hotkey HKEY 00000080 00005009
action=/etc/acpi/x41tsdown.sh</pre>
<blockquote><p>sudo nano /etc/acpi/events/x41t-swivel-up</p></blockquote>
<pre># /etc/acpi/events/x41t-swivel-up
# called when tablet head swivels up
event=ibm/hotkey HKEY 00000080 0000500a
action=/etc/acpi/x41tsup.sh</pre>
<blockquote><p>sudo nano /etc/acpi/x41tsdown.sh</p></blockquote>
<pre>#!/bin/sh
#/etc/acpi/x41tsdown.sh

echo 'Rotating Tablet...'
/usr/local/bin/rotatetablet right</pre>
<blockquote><p>sudo nano /etc/acpi/x41tsup.sh</p></blockquote>
<pre>#!/bin/sh
#/etc/acpi/x41tsup.sh

echo 'Unrotating Tablet...'
/usr/local/bin/rotatetablet normal</pre>
<p>und die beiden Shell-Skripte noch ausführbar machen</p>
<blockquote><p>sudo chmod +x /etc/acpi/x41tsdown.sh<br />
sudo chmod +x /etc/acpi/x41tsup.sh</p></blockquote>
<p>Dann ACPID einmal neustarten, damit die neuen Events auch aufgefangen werden</p>
<blockquote><p>sudo service acpid restart</p></blockquote>
<h3>Tastatur</h3>
<p>Bei mir laufen mittlerweile auch die Hardware-Tasten am Screen (rotate usw....) out-of-the-box, heißt ich kann ihnen direkt per System > Einstellungen > Tastenkombinationen den Tasten einen Befehl zuweisen (zb. /usr/local/bin/rotatetablet.sh)</p>
<p>Quellen:<br />
<a href="http://liken.otsoa.net/blog/index.php?entry=entry080617-120522">Liken Apuntes</a><br />
<a href="http://wordsarelies.blogspot.com/2009/05/ubuntu-904-jaunty-on-thinkpad-x41.html">Words Are Lies</a><br />
<a href="http://www.linux.com/community/blogs/installing-ubuntu-904-on-a-ibm-x41-tablet.html">Ross Larsen</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.cnlpete.de/2011/02/x41t-rotate-screen-on-swivel-events-on-10-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Thinkpad Ubuntu 10.04/10.10 Middle Mouse Scrolling</title>
		<link>http://blog.cnlpete.de/2010/10/thinkpad-ubuntu-10-0410-10-middle-mouse-scrolling/</link>
		<comments>http://blog.cnlpete.de/2010/10/thinkpad-ubuntu-10-0410-10-middle-mouse-scrolling/#comments</comments>
		<pubDate>Tue, 26 Oct 2010 19:51:18 +0000</pubDate>
		<dc:creator>cnlpete</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[10.04]]></category>
		<category><![CDATA[10.10]]></category>
		<category><![CDATA[MiddleMouseScrolling]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[X41t]]></category>

		<guid isPermaLink="false">http://blog.cnlpete.de/?p=385</guid>
		<description><![CDATA[Seit Ubuntu 10.04 nutzt Ubuntu wieder das alte xorg-Konfiguration anstatt der hal/udev Methode. Für uns heißt das, dass wir einfach eine xorg-Konfigurationsdatei in xorg.conf.d schmeißen: Für 10.04: sudo nano /usr/lib/X11/xorg.conf.d/20-thinkpad.conf Für 10.10: sudo nano /usr/share/X11/xorg.conf.d/20-thinkpad.conf und fügen folgenden Inhalt ein: Section "InputClass" Identifier "Trackpoint Wheel Emulation" MatchProduct "TPPS/2 IBM TrackPoint&#124;DualPoint Stick&#124;Synaptics Inc. Composite TouchPad / [...]]]></description>
			<content:encoded><![CDATA[<p>Seit Ubuntu 10.04 nutzt Ubuntu wieder das alte xorg-Konfiguration anstatt der hal/udev Methode. <span id="more-385"></span>Für uns heißt das, dass wir einfach eine xorg-Konfigurationsdatei in xorg.conf.d schmeißen:</p>
<p>Für <strong>10.04</strong>:</p>
<blockquote><p>sudo nano /usr/lib/X11/xorg.conf.d/20-thinkpad.conf</p></blockquote>
<p>Für <strong>10.10</strong>:</p>
<blockquote><p>sudo nano /usr/share/X11/xorg.conf.d/20-thinkpad.conf</p></blockquote>
<p>und fügen folgenden Inhalt ein:</p>
<pre>Section "InputClass"
 Identifier	"Trackpoint Wheel Emulation"
 MatchProduct	"TPPS/2 IBM TrackPoint|DualPoint Stick|Synaptics Inc.  Composite TouchPad / TrackPoint|ThinkPad USB Keyboard with TrackPoint"
 MatchDevicePath	"/dev/input/event*"
 Option		"EmulateWheel"		"true"
 Option		"EmulateWheelButton"	"2"
 Option		"Emulate3Buttons"	"false"
 Option		"XAxisMapping"		"6 7"
 Option		"YAxisMapping"		"4 5"
 Option		"EmulateWheelTimeout"	"200"
 EndSection</pre>
<p>Dann einfach nur noch den X-Server neustarten (durch Neustarten, oder Ab-Anmelden) und voila <img src='http://blog.cnlpete.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Quelle:</p>
<p>http://www.eastwoodzhao.com/thinkpad-middle-button-scroll-ubuntu-linux-10-04-lucid-lynx/</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.cnlpete.de/2010/10/thinkpad-ubuntu-10-0410-10-middle-mouse-scrolling/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

