2010年9月17日星期五

Ubuntu 10.04 thinkpad x201t 旋转按钮的安装

现安装wabcomrotate,否则只能旋转控制面板,手写笔不能旋转。
地址如下:https://launchpad.net/~thjaeger/+archive/tabletpc

This PPA can be added to your system manually by copying the lines below and adding them to your system's software sources.

Display sources.list entries for:
deb http://ppa.launchpad.net/thjaeger/tabletpc/ubuntu lucid main
deb-src http://ppa.launchpad.net/thjaeger/tabletpc/ubuntu lucid main
Signing key:
1024R/9E691625 (What is this?)
Fingerprint:
8197E7DD43CE7D385D3CB538D24C9B879E691625
=====================================================
完毕后安装 脚本。
地址如下:http://ubuntuforums.org/showthread.php?t=1460380&page=2/

Hi my friend,
here is what I did on my X61 tablet:

First create a file to store the current rotation data

Code:
sudo gedit /usr/bin/rotationmode
fill this file with:

Code:
0
and make it editable, but not executable

Code:
sudo chmod 666 /usr/bin/rotationmode
Now we will write the script to rotate the screen

Code:
sudo gedit /usr/bin/rotatebutton
And fill it with:



Code:
mode=`cat /usr/bin/rotationmode`
if test 0 = $mode
then
echo 1 > /usr/bin/rotationmode
xrandr -o right
fi
if test 1 = $mode
then
echo 2 > /usr/bin/rotationmode
xrandr -o inverted
fi
if test 2 = $mode
then
echo 3 > /usr/bin/rotationmode
xrandr -o left
fi
if test 3 = $mode
then
echo 0 > /usr/bin/rotationmode
xrandr -o normal
fi
Make it executable:
Code:
sudo chmod +x /usr/bin/rotatebutton
Now typing rotatebutton in terminal should go through all of the rotations
To map the command to the button go to System>Preferences>Keyboard Shortcuts, click the Add button at the bottom, name it whatever you want and use the command rotatebutton. Then bind the key by clicking in the shortcut column and pressing the tablet rotate key.

PS: I prefer only to have normal and inverted rotation in my button,
in which occasion you can modify the script to something like:

Code:
mode=`cat /usr/bin/rotationmode`
if test 0 = $mode
then
echo 1 > /usr/bin/rotationmode
xrandr -o inverted
fi
if test 1 = $mode
then
echo 0 > /usr/bin/rotationmode
xrandr -o normal
fi
Hope you'll be fine with that...

=====================================
搞定,就是这么简单.

2 条评论:

  1. Rotate the screen and the pen with the rotation button.

    Source:

    * Ubuntu Forum Screen rotation on X61t in Lucid
    * Tips and Tricks for Tablet

    First install wacomrotate:

    sudo add-apt-repository ppa:thjaeger/tabletpc
    sudo apt-get install wacomrotate

    Create a file to store the current rotation data:

    sudo gedit /usr/bin/rotationmode

    fill this file with:

    0

    and make it editable, but not executable

    sudo chmod 666 /usr/bin/rotationmode

    Now we will write the script to rotate the screen

    sudo gedit /usr/bin/rotatebutton

    And fill it with:

    mode=`cat /usr/bin/rotationmode`
    if test 0 = $mode
    then
    echo 1 > /usr/bin/rotationmode
    xrandr -o right
    fi
    if test 1 = $mode
    then
    echo 2 > /usr/bin/rotationmode
    xrandr -o inverted
    fi
    if test 2 = $mode
    then
    echo 3 > /usr/bin/rotationmode
    xrandr -o left
    fi
    if test 3 = $mode
    then
    echo 0 > /usr/bin/rotationmode
    xrandr -o normal
    fi

    Make it executable:

    sudo chmod +x /usr/bin/rotatebutton

    Now typing rotatebutton in terminal should go through all of the rotations. To map the command to the button go to System>Preferences>Keyboard Shortcuts, click the Add button at the bottom, name it whatever you want and use the command rotatebutton. Then bind the key by clicking in the shortcut column and pressing the tablet rotate key.

    PS: I prefer only to have normal and inverted rotation in my button, in which occasion you can modify the script to something like:

    mode=`cat /usr/bin/rotationmode`
    if test 0 = $mode
    then
    echo 1 > /usr/bin/rotationmode
    xrandr -o inverted
    fi
    if test 1 = $mode
    then
    echo 0 > /usr/bin/rotationmode
    xrandr -o normal
    fi

    回复删除
  2. Setup the Tablet Rotate Button

    This key needs to be set to a keycode. Pick any empty one (240 is usually empty)

    sudo setkeycodes 6c 240

    回复删除

写下你的意见和问题,一起进步。谢谢