Posts Tagged ‘thinkpad ubuntu’

Rotating screen in Thinkpad x61T Tablet with Ubuntu Karmic

Tuesday, February 2nd, 2010

If you read my comments on my own post on screen rotation on my thinkpad tablet you’ll read that I was having problems rotating my screen on my X61T tablet (1400×1050 resolution). I didn’t have any luck with that until this week, when I had some time to do some research again.

Thanks to this site, I am now able to do it:
http://www.shrapnull.com/v1/node/22

Basically, the scripts here are much simpler and cleaner.
Below is the code to rotate the screen :

#!/bin/sh
#/etc/acpi/x200tsdown.sh
echo ‘Rotating screen…’
if [ "`/usr/bin/xrandr -o right -v | grep -i 'randr' | wc -l`" -ne "1" ]
then
echo ‘!! Something went wrong…’
export DISPLAY=”:0.0″
export XAUTHORITY=/var/lib/gdm/\:0.Xauth
/bin/xset -display $DISPLAY dpms
echo ‘Trying to rotate again…’
/usr/bin/xrandr -o right
fi
echo ‘Rotating stylus…’
/usr/bin/xsetwacom set stylus rotate cw
echo ‘Starting keyboard…’
/usr/bin/onboard&

Now, this code doesn’t *quite* work 100%. Somehow on the x61t, the wacom digitiser is not listed as “stylus”. Instead, running the command

xsetwacom list

shows me that it is listed as “eraser”. So the script works perfectly when you replace “/usr/bin/xsetwacom set stylus rotate cw” with “/usr/bin/xsetwacom set eraser rotate cw”

What I couldn’t get working was the acpi events. It basically means that I can’t get the tablet to rotate automatically when I flipped it to tablet mode, and revert to normal orientation when I flipped it back to laptop mode.

Instead, I used Gnome’s System-> Preferences -> Keyboard Shortcuts to map the tablet rotation key to launch the rotation script, and the Thinkvantage key to launch the back-to-normal script.

I couldn’t find a way to override the Tablet “Toolbox” key NOT to go into screensaver mode… something for me to do in future I guess.

Oh yes, and the instructions here http://liken.otsoa.net/blog/index.php?entry=entry080617-120522 on Keyboard in GDM and Screen Lock

GDM

In /etc/gdm/Init/Default, before exit 0, add:

/usr/bin/cellwriter –keyboard-only –read-only –window-y=600 –window-x=200 &

In /etc/gdm/PostLogin/Default, add:

killall -u root cellwriter &

In /etc/gdm/PostSession/Default, before exit 0, add:

sudo killall -u $USER cellwriter

SCREEN LOCK

Edit Gnome Registry with gconf-editor. In apps/gnome-screensaver

embedded_keyboard_command cellwriter –keyboard-only –xid
embedded_keyboard_enabled [TRUE]

works very well.

I am happy. :-)

Changing Virtual Desktop Resolution on my Thinkpad X60 running Jaunty

Monday, June 15th, 2009

With the change of the way Ubuntu interfaces with its hardware (through FDI files), it took me a while to figure out how to change the default virtual desktop so that I could do extended desktop on my Thinkpad X60 tablet to use screens that are 1400 pixels wide or greater.

It turns out to be very straight forward:
Edit your /etc/X11/xorg.conf to have the following section:

Section "Screen"
	Identifier	"Default Screen"
	Monitor		"Configured Monitor"
	Device		"Configured Video Device"
	SubSection "Display"
		Virtual 2840 1050
	EndSubSection
EndSection

So now when I encounter projectors/screens that are wider than 1024 pixels, I can still do extended desktop by using either the Fn+F7 key, or going to the System -> Preferences -> Display application.

Middle Button Trackpoint Scrolling on Thinkpad X60 Tablet with Jaunty

Friday, June 5th, 2009

Strangely, this information wasn’t easy to find because the same .fdi script that worked on my X200 didn’t work on the X60. Most likely was the wrong product info attribute in the fdi file (lshal | grep IBM on the X60T gives me this -> info.product = ‘TPPS/2 IBM TrackPoint’)

Anyway, found the correct directive here:
http://www.thinkwiki.org/wiki/How_to_configure_the_TrackPoint#vertical_scrolling

<match key="info.product" string="TPPS/2 IBM TrackPoint">
 <merge key="input.x11_options.EmulateWheel" type="string">true</merge>
 <merge key="input.x11_options.EmulateWheelButton" type="string">2</merge>
 <merge key="input.x11_options.YAxisMapping" type="string">4 5</merge>
 <merge key="input.x11_options.XAxisMapping" type="string">6 7</merge>
 <merge key="input.x11_options.Emulate3Buttons" type="string">true</merge>
 <merge key="input.x11_options.EmulateWheelTimeout" type="string">200</merge>
</match>

Strangely, apparently this fdi directive doesn’t work on the X61T, and something needs to be changed.
See: http://ubuntuforums.org/showthread.php?t=1139856&page=2

Screen Rotation for Jaunty on my x60 Tablet

Monday, June 1st, 2009

As mentioned before, Jaunty has been running very well and fine on my Thinkpad X200. While surfing on Hardwarezone the other day, I saw an ad putting an x60 tablet for sale. In the end, I traded in my Thinkpad X41 Tablet for a 2nd hand X60 Tablet - main advantage being that the X60 tablet has a 1400×1050screen resolution - even more than my x200.

Anyway, the initial install and stuff went pretty ok, with the stylus being recognised immediatley and all. But the problem started when I tried to do screen rotation on my tablet. Firstly, I realised that instructions online that tweaked the xorg.conf file didnt work anymore because Ubuntu has changed the way it configured hardware, using fdi xml-formatted files instead. Anyway,here is the exact steps I did to get screen rotation to work:

Steps

  1. Clean install of Jaunty on x60
  2. apt-get install wacom-tools
  3. Download this script http://liken.otsoa.net/pub/x41t/rotatetablet and save it to /usr/local/bin/rotate
  4. chmod 755 /usr/local/bin/rotate
  5. sudo vi /etc/init.d/wacomtohal

and paste in these lines:

#! /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

Save it, close it, and run these two commands in terminal:

sudo chmod +x /etc/init.d/wacomtohal
sudo update-rc.d wacomtohal defaults 27

Explanation

Step (4) is to create an auto-run script that changes some values in HAL in Jaunty so that the wacom device in thinkpad tablet can be seen by the rotate script. Somehow in Jaunty, the way wacom devices are named in HAL is diferent.  So, the script wacomtohal changes it so that the rotate script works.  If you didn’t run this, the rotate script in Step (3) would rotate the screen only and have the error message xsetwacom device “stylus” not found. The stylus would not rotate, resulting in a case of all stylus positions being rotated 90 degree off centre.  It took a full re-installation to get this right becuase there are so many instructions online telling you what to do with different versions of Ubuntu.

References

Init.d script:  http://wordsarelies.blogspot.com/2009/05/ubuntu-904-jaunty-on-thinkpad-x41.html
Rotation script: http://liken.otsoa.net/blog/index.php?entry=entry080617-120522