<?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; wacom</title>
	<atom:link href="http://blog.cnlpete.de/tag/wacom/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>X41t &#8211; Rotate Screen + Wacom Stylus on Swivel Events</title>
		<link>http://blog.cnlpete.de/2009/10/screen-rotat/</link>
		<comments>http://blog.cnlpete.de/2009/10/screen-rotat/#comments</comments>
		<pubDate>Thu, 29 Oct 2009 14:31:36 +0000</pubDate>
		<dc:creator>cnlpete</dc:creator>
				<category><![CDATA[Desktop]]></category>
		<category><![CDATA[9.10]]></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=234</guid>
		<description><![CDATA[wacom-tools installieren Da zwar der touch von Haus aus funktioniert, aber nicht wirklich konfigurierbar ist, habe ich die wacom-treiber installiert. Geht auch ganz einfach aus den Paketquellen: sudo apt-get update sudo apt-get install wacom-tools xserver-xorg-input-wacom Da allerdings seit 9.04 die input-devices umbenannt wurden, finden sämtliche gerade installierten Tools das Touc-Display nicht. Jedoch gibt es auch [...]]]></description>
			<content:encoded><![CDATA[<h1>wacom-tools installieren</h1>
<p>Da zwar der touch von Haus aus funktioniert, aber nicht wirklich konfigurierbar ist, habe ich die wacom-treiber installiert.<span id="more-234"></span><br />
Geht auch ganz einfach aus den Paketquellen:</p>
<blockquote><p>sudo apt-get update<br />
sudo apt-get install wacom-tools xserver-xorg-input-wacom</p></blockquote>
<p>Da allerdings seit 9.04 die input-devices umbenannt wurden, finden sämtliche gerade installierten Tools das Touc-Display nicht. Jedoch gibt es auch hierfür eine Lösung, wir schreiben uns einfach ein Skript, welches die devices kurzerhand beim Start umbenennt (gefunden bei <a href="http://blog.aliencam.net/2009/06/ubuntu-setup-guide-viii-wacom-tablet-config/">aliencam</a>).</p>
<blockquote><p>sudo nano /etc/init.d/wacom-names</p></blockquote>
<pre>#! /bin/sh
## find any wacom devices
for udi in `hal-find-by-property --key input.x11_driver --string wacom`
do
type=`hal-get-property --udi $udi --key input.x11_options.Type`
## rewrite the names that the Xserver will use
hal-set-property --udi $udi --key info.product --string $type
done</pre>
<p>Dieses muss ausfürbar gemacht werden, und in die runlevels aufgenommen werden. Wichtig, es muss nach HAL aber vor X gestartet werden.</p>
<blockquote><p>sudo chmod +x /etc/init.d/wacom-names<br />
sudo update-rc.d wacom-names defaults 27</p></blockquote>
<p>Der dabei resultierende Fehler ist zu vernachlässigen. (Er entsteht, da wir nicht alle Runlevels berücksichtigen, sondern nur die beim starten durchlaufenden)</p>
<p>Nun einmal den Rechner neustarten und nach dem starten mit<br />
<blockquote>xsetwacom list</p></blockquote>
<p> prüfen ob etwas gefunden wird.</p>
<p>Wenn dies funktioniert kann zb mit <strong>wacomcpl</strong> der stylus beliebig konfiguriert werden.</p>
<h2 name="setup" id="setup">Alternativ im Schnelldurchlauf</h2>
<blockquote><p>
wget http://download.cnlpete.de/scripting/wacom-names<br />
sudo cp wacom-names /etc/init.d/wacom-names<br />
rm wacom-names<br />
sudo chmod +x /etc/init.d/wacom-names<br />
sudo update-rc.d wacom-names defaults 27
</p></blockquote>
<h1>rotate-script und swivel-events</h1>
<p><strong>Achtung, die 5 Skripte die ich im folgenden erläutere können auch direkt herunter geladen werden, siehe <a href="#setup">unten</a></strong></p>
<h3>rotatetablet Skript</h3>
<p>Als erstes erstellen wir das rotate-Skript, welches eine beliebige Rotierung des Bildschirms mittels xrandr erlaubt, gefunden <a href="http://liken.otsoa.net/blog/index.php?entry=entry080617-120522">hier</a> und angepasst, da ich kein Compiz nutze.</p>
<blockquote><p>sudo nano /usr/local/bin/rotatetablet</p></blockquote>
<pre>#!/bin/bash

#STATUS_FILE=~/.rotate-status
STATUS_FILE=/tmp/.rotate-status

######################## 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;
		keymap 0
		;;
        1|left)
		N=1;
		T=ccw;
		keymap 1
		;;
        2|inverted)
		N=2;
		T=half;
		keymap 0
		;;
        0|normal)
		N=0;
		T=none;
		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 &#038; \

    #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 &#038;
    fi

    xsetwacom set stylus Rotate $T &#038; \
    echo $N > $STATUS_FILE
}

if [ "$#" == "0" ]; then
    rotate $(((3+0$(cat $STATUS_FILE 2>/dev/null))%4))
else
    rotate $1
fi</pre>
<p>dann machen wir das Skript noch ausführbar:</p>
<blockquote><p>sudo chmod +x /usr/local/bin/rotatetablet</p></blockquote>
<p>Nun kann zum testen schonmal versucht werden den Bildschirm zu drehen, durch einen einfachen Aufruf von <strong>rotatetablet</strong></p>
<blockquote><p>rotatetablet #rotate to the left<br />
rotatetablet normal #normalize again</p></blockquote>
<p>Wenn das klappt können wir mit den swivel-events fortfahren.</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<br />
<blockquote>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>
<p>.</p>
<h2 name="setup" id="setup">im Schnelldurchlauf</h2>
<blockquote><p>
wget http://download.cnlpete.de/scripting/rotate/x41t-swivel-down<br />
wget http://download.cnlpete.de/scripting/rotate/x41t-swivel-up<br />
wget http://download.cnlpete.de/scripting/rotate/x41tsdown.sh<br />
wget http://download.cnlpete.de/scripting/rotate/x41tsup.sh<br />
wget http://download.cnlpete.de/scripting/rotate/rotatetablet</p>
<p>sudo cp x41t-swivel-down /etc/acpi/events/x41t-swivel-down<br />
sudo cp x41t-swivel-up /etc/acpi/events/x41t-swivel-up<br />
sudo cp x41tsdown.sh /etc/acpi/x41tsdown.sh<br />
sudo cp x41tsup.sh /etc/acpi/x41tsup.sh<br />
sudo cp rotatetablet /usr/local/bin/rotatetablet</p>
<p>rm x41t-swivel-down<br />
rm x41t-swivel-up<br />
rm x41tsdown.sh<br />
rm x41tsup.sh<br />
rm rotatetablet</p>
<p>sudo chmod +x /etc/acpi/x41tsdown.sh<br />
sudo chmod +x /etc/acpi/x41tsup.sh<br />
sudo chmod +x /usr/local/bin/rotatetablet</p>
<p>sudo service acpid restart
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blog.cnlpete.de/2009/10/screen-rotat/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

