2010年9月17日星期五
Ubuntu 10.04 on Thinkpad x61 Tablet
Introduction
This page covers the additional hardware setup required after installing Ubuntu 10.04 (Lucid Lynx) to make the Thinkpad X61 Tablet Fully Functional.
What Works
Tested
Audio Buttons, Brightness Fn Buttons, Radio Fn Button, Suspend Fn Button, Tablet L/R/U/D Buttons, Tablet Enter Button, Tablet Esc Button, NumberLock Fn Button, Tablet Pen, Wireless Radio,
Assumed Working
Forward / Back Buttons, Power Fn Button, Lock Fn Button, Hibernate Fn Button, Media Fn Buttons Bluetooth Radio,
What Almost Works
Tablet Toolbox Button - causes lock or suspend, Tablet Touch – Requires Calibration.
What Does Not Work
Tablet Control-Alt-Delete Button, Tablet Rotate Button, Middle Mouse Button, ThinkVantage Button, Magnify Fn Button, Fingerprint Reader, Automatic Screen Rotation, ThinkVantage ActiveProtection,
Setup Stylus and Rotate
This is the easiest and most reliable way I found out how to get it working. Quick and Easy.
Stylus:
In order to prevent the stylus from sending clicks when the tip isn’t touching the screen and map the single button to a left-click.
Source: Peterbn on Wordpress
Add the following to the 10-wacom.conf file (Identifier "Wacom serial class"):
- Option "TPCButton" "on"
- Option "Button2" "3"
sudo gedit /usr/lib/X11/xorg.conf.d/10-wacom.conf
This is how the section should look like:
Section "InputClass"
Identifier "Wacom serial class"
MatchProduct "Serial Wacom Tablet"
Driver "wacom"
Option "ForceDevice" "ISDV4"
Option "TPCButton" "on"
Option "Button2" "3"
EndSection
Rotate:
Rotate the screen and the pen with the rotation button.
Source:
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
Fixing Touch
Works out of the box, just needs some calibration.
xsetwacom
It took me some time to find this one. So, i'll post it here so you won't have to spend time finding it. These numbers calibrate touch for my X61. I hope it will be the same for other X61's.
#!/bin/sh
xsetwacom set "Serial Wacom Tablet touch" topy "85"
xsetwacom set "Serial Wacom Tablet touch" topx "51"
xsetwacom set "Serial Wacom Tablet touch" bottomx "933"
xsetwacom set "Serial Wacom Tablet touch" bottomy "957"
The numbers where acquired using xinput_calibrator.
xinput_calibrator
http://www.freedesktop.org/wiki/Software/xinput_calibrator
Using this tool you can find the numbers to calibrate your touchscreen. It's a pity it is still not in the repositories (as of 24/06/2010)
Install as per instructions on the freedesktop site.
Then run:
xinput_calibrator_x11 --device "Serial Wacom Tablet touch"
The tool does not actually calibrate the tablet. It merely shows you the numbers needed for calibration. Work in progress, i guess.
Wacomcpl (Will not work because HAL is missing)
(I think, it isn't working, because we haven't got wacomcpl in 10.04.)
Wacomcpl is no longer available in 10.04. The new package is xserver-xorg-input-wacom. How to calibrate the screen is being looked into. The xsetwacom command is still intact to set the calibrations though.
The Wacom Tablet in the X61t is a serial Wacom tablet. It can be configured by using wacomcpl. Wacomcpl is part of the wacom-tools package and can be retrieved in apt:
sudo apt-get install wacom-tools
After this wacomcpl can be run by typing:
wacomcpl
in Terminal.
Helping wacomcpl
Unfortunately HAL assigns names to wacom devices in a way that the recent wacomcpl from jaunty cant find them, to help wacomcpl to find them:
Open a terminal and type:
sudo gedit /etc/init.d/wacomtohal
and paste this code in:
#! /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
then run :
sudo chmod +x /etc/init.d/wacomtohal
sudo update-rc.d wacomtohal defaults 27
now reboot and launch wacomcpl
Making Wacomcpl Settings Restore on Reboot
If you lose your calibration after reboot:
In terminal:
sudo gedit ~/.xinitrc
Find the line that says:
. /etc/X11/xinit/xinitrc
and change it to
#. /etc/X11/xinit/xinitrc
Save and exit.
Go to System>Preferences>Startup Applications and create a new entry named whatever you want.
The command should be:
sh /home/yourusername/.xinitrc
Your wacomcpl settings will now restore on reboot
Fixing the Tablet Toolbox Button
This key needs to be set to a keycode. Pick any empty one (241 is usually empty)
sudo setkeycodes 68 241
Now you can bind this key to any command.
Setup the Tablet Control-Alt-Delete Button
This key needs to be set to a keycode. Pick any empty one (242 is usually empty)
sudo setkeycodes 67 242
Now you can bind this key to any command.
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
Now you can bind this key to any command. (It should be possible to write a script to interact with the autorotate given on this page)
Setup the Middle Button Scrolling
The easy apt-get way
sudo apt-get install gpointing-device-settings
The hard way
Which probably will not work because it depends op HAL.
Open a terminal and run each of the following for vertical scrolling:
xinput set-prop 'TPPS/2 IBM TrackPoint' "Evdev Wheel Emulation" 1
xinput set-prop 'TPPS/2 IBM TrackPoint' "Evdev Wheel Emulation Button" 2
xinput set-prop 'TPPS/2 IBM TrackPoint' "Evdev Wheel Emulation Timeout" 200
Add the following if you want horizontal scrolling:
xinput set-prop 'TPPS/2 IBM TrackPoint' "Evdev Wheel Emulation Axes" 6 7 4 5
If you do not want to run these commands every time you restart your computer, copy them to a script file.
In Ubuntu, create a new file in your Home directory called "Mouse_Wheel.sh". Using gedit, paste the commands into the file and save.
Open the terminal and type:
chmod +x Mouse_Wheel.sh
Go to System > Preferences > Startup Applications. Click on "Add", in the Name box type "Mouse Wheel" and in the Command box type "./Mouse_Wheel.sh".
In Kubuntu, place the script file in ~/.kde/Autostart.
HAL has been deprecated so the following might still work but is not suggested: Create a new file called /etc/hal/fdi/policy/mouse-wheel.fdi typing:
sudo gedit /etc/hal/fdi/policy/mouse-wheel.fdi
And fill it with this code:
true 2 6 7 4 5 4 5 true
Setup ThinkVantage Button
The ThinkVantage button does not work only in that it is not bound to anything. To bind it go to System>Preferences>Keyboard Shortcuts and set it to perform any command.
Setup Magnify Fn Button
No Solution Yet.
Setup Fingerprint Reader
The Thinkfinger driver works fine on the X61. The following is the paraphrased commands from the installing thinkfinger page that are relevant to the X61 and Ubuntu 9.04.
In terminal, add a key:
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com F2A12FABE936A7BBDC4EA33351DB180D1323E149
Add the PPA repositories to your sources.list (/etc/apt/sources.list):
deb http://ppa.launchpad.net/jon-oberheide/ppa/ubuntu jaunty main
deb-src http://ppa.launchpad.net/jon-oberheide/ppa/ubuntu jaunty main
Update installer:
sudo apt-get update
And install:
sudo apt-get install thinkfinger-tools libpam-thinkfinger
Now the driver is installed and should be working. You can try it (as root) with
sudo tf-tool --acquire
and
sudo tf-tool --verify
This will ask you to swipe your finger three times, save the fingerprint to /tmp/test.bir and then verify your fingerprint with the bir-file.
Setup Pam:
sudo /usr/lib/pam-thinkfinger/pam-thinkfinger-enable
Add user:
tf-tool --acquire $USERNAME
Optional: Change the login screen to allow keyboard-less login:
Go to: System>Administration>Login Window
Click on the 'Local' tab.
Set the drop-down boxes to: 'Themed with face browser' and 'Selected Only' and choose 'Human List' from the list of logins.
Note: it may take some time for the reader to startup, give it 5 seconds before use and before pressing enter to initiate login.
Setup Automatic Screen Rotation
Automatic Switching from Laptop to Tablet mode
The following was inspired by Installing Ubuntu 8.10 (Intrepid Ibex) on an X61 Tablet, with some minor additions:
- put the following in /etc/acpi/events/lenovo-rotate-normal
# /etc/acpi/events/lenovo-rotate-normal
# This is called when the user rotates the screen to laptop mode
event=ibm/hotkey HKEY 00000080 0000500a
action=/etc/acpi/thinkpad-rotatescreen.sh right
- put the following in /etc/acpi/events/lenovo-rotate-tablet
# /etc/acpi/events/lenovo-rotate-tablet
# This is called when the user rotates the screen to tablet mode
event=ibm/hotkey HKEY 00000080 00005009
action=/etc/acpi/thinkpad-rotatescreen.sh normal
- put the following in /etc/acpi/thinkpad-rotatescreen.sh and make it executable
#!/bin/sh
#
# This script rotates the display in TabletPCs when screen is changed from
# laptop to tablet mode, or when rotation button is pressed
test -f /usr/share/acpi-support/key-constants || exit 0
. /usr/share/acpi-support/power-funcs
# i'm not trusting this ...
#if [ -f /var/lib/acpi-support/screen-rotation ] ; then
# ROTATION=`cat /var/lib/acpi-support/screen-rotation`
#fi
# ... and thus calling this with a parameter
ROTATION="$1" # this should be called "ROTATION_FROM"
case "$ROTATION" in
right)
NEW_ROTATION="normal"
NEW_WACOM="none"
;;
*)
NEW_ROTATION="right"
NEW_WACOM="cw"
;;
esac
for x in /tmp/.X11-unix/*; do
displaynum=`echo $x | sed s#/tmp/.X11-unix/X##`
getXconsole;
if [ x"$XAUTHORITY" != x"" ]; then
export DISPLAY=":$displaynum"
/usr/bin/xrandr -o $NEW_ROTATION && echo $NEW_ROTATION > /var/lib/acpi-support/screen-rotation
# rotate the stylus
for type in "Serial Wacom Tablet eraser" "Serial Wacom Tablet touch" "Serial Wacom Tablet" ; do
/usr/bin/xsetwacom set "$type" rotate $NEW_WACOM
done
# rotate the arrow keys
case "$NEW_ROTATION" in
right)
xmodmap - <keycode 114 = Up NoSymbol Up NoSymbol Up
keycode 111 = Left NoSymbol Left NoSymbol Left
keycode 116 = Right NoSymbol Right NoSymbol Right
keycode 113 = Down NoSymbol Down NoSymbol Down
END
;;
*)
xmodmap - <keycode 111 = Up NoSymbol Up NoSymbol Up
keycode 113 = Left NoSymbol Left NoSymbol Left
keycode 114 = Right NoSymbol Right NoSymbol Right
keycode 116 = Down NoSymbol Down NoSymbol Down
END
;;
esac
fi
done
Note: check the output of
xsetwacom list dev
to identify the devices to put in the line
for type in "Serial Wacom Tablet eraser" "Serial Wacom Tablet touch" "Serial Wacom Tablet" ; do
My system has a touch and a cursor device.
Automatic rotating of display in Tablet mode
Install Karol Krizka's AutoRotate daemon.
sudo add-apt-repository ppa:kkrizka/thinkpad-x61t
sudo apt-get update
sudo apt-get install python-glib python-dbus python-xrandr autorotate
Set up the daemon to start with Gnome
sudo gedit /etc/gdm/Init/Default
Add the following line before the last "exit"
auto-rotate.py &
Save your work before restarting Gnome
sudo /etc/init.d/gdm restart
You're all set. Note that there is also a manual-rotate.py script that comes with AutoRotate that can be bound to the special function Rotate key. See the author's site above for help with setting the keyboard shortcuts.
Setup ThinkVantage ActiveProtection
sudo cp /etc/modules /etc/modules_backup
sudo aptitude install tp-smapi-source
sudo module-assistant prepare tp-smapi
sudo module-assistant auto-install tp-smapi
sudo modprobe tp-smapi
sudo aptitude install hdapsd
echo 'tp-smapi' | sudo tee -a /etc/modules
You can set the activeprotection sensivity:
cd /etc/default/
gedit hdapsd
# sensitivity
SENSITIVITY=25
Now you can try, if the modules are loaded yet. Do so with
lsmod | grep hdaps
if not perform:
sudo modprobe -a thinkpad_ec tp_smapi hdaps
If the installation of hdapsd succeeded, you can test it by typing this into your terminal:
sudo hdapsd -d sda -s 15 -a -v -y
If you suddenly move your laptop the output will change! (stop it with pressing Ctr + C)
Useful Task: Disable Bluetooth on Startup
These instructions will disable the bluetooth radio being activated during the boot. The radio can then be activated at the users discretion using Fn F5 (Radio Fn Button).
edit /etc/rc.local and add:
chmod 666 /proc/acpi/ibm/bluetooth
echo "disable" > /proc/acpi/ibm/bluetooth
before the 'exit 0' line
- note chmod 666 makes this file editable by everyone, this may compromise security, try different settings to find the one that suits your needs (655 may work)
- note proc is depreciated and may not work in future releases
Useful Task: Enable Laptop Mode
Laptop mode is a power saving tool that allows the hard drive to spin down to conserve battery power. This is disabled by default as it has been known to cause problems on some computers, but it appears to work on the X61t.
- Warning: Laptop mode stores data in ram teporarily until it needs to write to disk. Power Loss in laptop mode could lead to significant data loss.
- Warning: Excessive spin-up spin-down cycles will wear out your hard drive much more quickly than normal use. Be careful when configuring laptop mode settings.
- Warning: Do Not Use Laptop Mode if you have a SSD. It is for platter drives only.
Edit /etc/default/acpi-support
sudo gedit /etc/default/acpi-support
Set: "ENABLE_LAPTOP_MODE=true"
Configure Laptop Mode
sudo gedit /etc/laptop-mode/laptop-mode.conf
Optional Task: Adjusting Trackpoint Settings
If you find that your trackpoint pointer is too slow, use control-trackpoint to adjust your settings.
To install, install sysfsutils first, as per tpctl's documentaton
sudo apt-get install sysfsutils
then install the .deb from sourceforge (the graphical installer worked for me). Once installed, run:
sudo configure-trackpoint
Sources
The above is a compilation of my notes from when I installed Jaunty on my X61t. The code and many of the instructions come from various pages and sources around the Internet. I will attempt to document them when time permits. If you see anything that should be added or wish to cite a source I missed, please edit the page.
Ubuntu 10.04 thinkpad x201t 旋转按钮的安装
地址如下: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.
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:
- I installed wacomrotate:https://launchpad.net/~thjaeger/+archive/tabletpc
- Then, I am modifying the page of this guy: https://help.ubuntu.com/community/X61T
First create a file to store the current rotation data
sudo gedit /usr/bin/rotationmode
0
sudo chmod 666 /usr/bin/rotationmode
sudo gedit /usr/bin/rotatebutton
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
sudo chmod +x /usr/bin/rotatebutton
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
=====================================
搞定,就是这么简单.
thinkpad ubuntu 快捷键
阅读灯控制按钮(FN + PgUp)
WLAN/BT/OFF 切换开关(Fn+F5 按一次: Wlan and BT 关掉/按第二次: BT off, Wlan 开/第三次: BT 开, Wlan 关/按第四次: BT 和 Wlan 开)
仅增加蓝牙切换 (Fn+F6) 不影响 WLAN (blackiron注:这个组合键在windows下按,没有什么反应)
Wlan/BT 硬件切换
Media player 控制 (FN + arrows)
浏览器历史按钮(原文是:Browser history buttons)
VGA输出 (FN + F7 按一次: 两个显示屏都显示/按两次: 输出屏显示,本机无信号/第三次:本机显示,输出屏无信号)
系统挂起热键 (FN + F4)
系统休眠热键(FN + F12)
电池信息热键 (FN + F3)
锁屏热键(FN + F2)
热键FN + F9没有测试
ThinkVantage 按钮 (你需要为其指定一个程序)
virtualbox出现 Kernel driver not installed (rc=-190
运行virtualbox后运行xp虚拟时,打不开,出现的第一个提示 窗口的提示内容如下:
不能为虚拟电脑 fgtr 打开一个新任务.
Virtual machine ‘fgtr’ has terminated unexpectedly during startup.
返回 代码:NS_ERROR_FAILURE (0×80004005)
组件:Machine
界面:IMachine {540dcfda-3df2-49c6-88fa-033a28c2ff85}
第二个提示窗口内容如下:
Kernel driver not installed (rc=-1908)
The VirtualBox Linux kernel driver (vboxdrv) is either not loaded or there is a permission problem with /dev/vboxdrv. Re-setup the kernel module by executing
‘/etc/init.d/vboxdrv setup’
as root. Users of Ubuntu, Fedora or Mandriva should install the DKMS package first. This package keeps track of Linux kernel changes and recompiles the vboxdrv kernel module if necessary.
出现这种情况可能是缺少模块,解决方法:
#安装module-assistant
sudo apt-get install module-assistant
#加载另一个模块
sudo modprobe vboxnetflt
ubuntu下gedit 乱码解决
gconf-editor
2. 展开左边的树节点,找到 /apps/gedit-2/preferences/encodings 节点并单击它。
3. 双击右边的 auto_detected 键,打开“编辑键”对话框。
4. 单击列表右边的“添加”按钮,输入“GB18030”,单击确定按钮。
5. 列表的最底部新增加了一个“GB18030”。单击选中它,并单击右边的 “向上” 按钮直到 “GB18030” 位于列表的顶部为止。
6. 单击确定按钮,关闭配置编辑器。
重装windows7后的修复 Ubuntu10.04的引导
十个需要牢记的Ubuntu快捷键(转)
如果你经常使用工作区,那你就可以用Ctrl + Alt +上/下方向键很容易地进行切换。左箭头切换到上一个工作区,右箭头切换到下一个工作区。如果你
2.把当前窗口移到另一个工作区
快捷键Shift+ Ctrl + Alt +左/右方向键让你很容易把当前窗口移到指定的工作区。这个快捷键和上面的快捷键很好配合。如果你工作时常常打开很多窗口,但又不想看到
3.显示桌面
Ctrl + Alt + D快捷键让你很快地最小化所有窗口,看 到桌面。当所有窗口都最小化后,你再按这个快捷键就可以恢复窗口原来的状态。
4.鼠标右击的键盘快捷键
在大多数程序里,你可以右击显示快捷菜单。其实键盘上
5.重启会话以从崩溃中恢复
ubuntu很少会完全崩溃。但如果它真的崩溃了,你可以按下Ctrl + Alt + Backspace来重启会话,恢复的可能达90%。
6.快速锁定屏幕
如果你需要离开电脑一会儿,可以按下Ctrl + Alt + L很快地锁定屏幕,以防有人使用
7.反向切换窗口
Alt + Tab是切换窗口的快捷键。如果你再按下SHIft,你就可以反向切换窗口。这个快捷键很有用,当你Alt + Tab按得太快,错过了你想要切换的窗口,按一下shift就可以返回之前的窗口了。
8.用方向键移动窗口
Alt+F7会激活移动窗口功能,用方向键(上,下,左,右)就可 以移到窗口了。
9.显示隐藏的
大多数情况下,你不需要在你的“家“目录中看到那些隐藏文件,但如果你有这个需要,你可以在Nautilus(ubuntu的文件管理器)下按Ctrl + H来显示隐藏文件。
10.不用右击鼠标就能显示文件属性
想要查看文件/文件夹的一般做法是右击选择属性。现在你可以按下
ubuntu 10.04 virtualbox 启用usb设备
ubuntu 系统清理
系统垃圾清理
添加源,安装goole earth 无乱码
sudo wget --output-document=/etc/apt/sources.list.d/medibuntu.list http://www.medibuntu.org/sources.list.d/$(lsb_release -cs).list && sudo apt-get --quiet update && sudo apt-get --yes --quiet --allow-unauthenticated install medibuntu-keyring && sudo apt-get --quiet update
sudo apt-get --yes install app-install-data-medibuntu apport-hooks-medibuntu
sudo apt-get install gooleearth
ubuntu 10.04 thinkpad 中键滚屏
系统->首选项->Pointing Devices配置鼠标中键
Use Wheel Button
Button选择2(在我的机器上是这个)
可以启动左右滚动或者上下滚动.
还有一个问题是现在的小红点移动感觉木木的,我们来给它加兴奋剂:
sudo gedit
游標速度,可調整數值。大為快,小為幔
echo -n 180 > /sys/devices/platform/i8042/serio1/speed
靈敏度,最高應為 255
echo -n 250 > /sys/devices/platform/i8042/serio1/sensitivity
|
按小紅點為選取,1 為啟用,0 為關閉。
echo -n 1 > /sys/devices/platform/i8042/serio1/press_to_select
exit 0
�