Saturday, June 26, 2010

ThinkPad X61 Tablet and Ubuntu Lucid Lynx | Karol Krizka

Since the Ubuntu Lucid Lynx was released, I've been fairly nervous about upgrading my laptop. It seems that with every update I've had to go through a long, arduous process of finding and reinstalling everything I once had. Especially getting the tablet to work correctly. However, thanks to this post by Karol Krizka, who has an identical laptop to mine, I didn't have to worry too much. He updated his system and tested that everything works out OK. He has even created an autorotate script for our x61 tablets that works wonderfully. I've discovered what seems to be a bug - the auto rotate only rotates into inverted and left modes, whoops! But you can click the manual buttons and that works fine, disabling the automatic rotation.

Wednesday, June 16, 2010

A Tablet...

We have already got a tablet and we need no more tablet!

So I've been running Ubuntu 9.04 on my laptop since pretty much the beginning. When 9.10 Karmic Koala was released I almost upgraded, but then I realized I was very near to the end of a semester and what a dumb idea that would be. Especially since I use my laptop for nigh on everything.

But recently I stumbled (or re-stumbled, as the case may be) upon a blog that has some great posts about the x61. It would seem he's got pretty much the same laptop as I have - I'm mainly led to believe this by the fact that he has no touch screen either.

Using this post, I finally got the HDAPS working, back when I was running Ubuntu 9.04.

But now that I'm in between semesters (starting up this Thursday), I upgraded to 9.10 (mainly because Krizka posted about his experience being fairly straightforward). Of course it messed with all my custom tweaks with the tablet rotation, so I had to fix that. Using Krizka's autorotate project I pretty much had no trouble. After getting my hdaps module working again, the autorotate worked perfectly - something I had never been able to accomplish previously. The only problem is that with my previous script when the tablet display was folded down I liked the screen to be inverted - I found that was the best for my use in school. So looking through some of the documentation and inspiration that Krizka posted/provided, and using some of the tools I came up with this result:

I created a python script called "rotate" (you could name it .py if you wanted, but I didn't) and inserted the following:

#!/usr/bin/python

import sys
import dbus
import pynotify
from traceback import print_exc

from libautorotate import *

D = DIRECTIONS = {'normal':1, 'left':2, 'right':8, 'inverted':4}

def main():

rotate = AutoRotate()
current = rotate.GetRotation()

if len(sys.argv) > 1:
try:
next = DIRECTIONS[sys.argv[1]]
except KeyError:
print sys.argv[1], 'is not a valid direction!'
sys.exit(1)
else:
rotate.SetRotation(next)

else:
rotate.SetNextRotation()


main()


Then:

sudo cp rotate /usr/local/bin/
sudo chmod 555 /usr/local/bin/rotate


After that, I created a file:


sudo vi /etc/acpi/events/swivel-down


into which I put the following (taken from here)


# Called when the tablet screen swivels down
event=ibm/hotkey HKEY 00000080 00005009
action=/usr/local/bin/rotate inverted


And now I have the best of both worlds. When I flip my screen down, it auto rotates to the orientation I like best (and I also have the ability to launch some extra programs if I need (though I think I may have to re-modify the wacomcpl script to automatically launch the config dialog... whoops, forgot to save that customization!)

So, this is really a big "Thank you!" to Karol Krizka

Wednesday, June 2, 2010

Chrome Trick

Are you such a Google fanboy/girl that you have more than one Google account? If you want to use both of these accounts in Google chrome you will have noticed that it doesn't work, even when opening a new window.

Instead of opening a new window, an incognito window. You'll share cookies etc. between your normal windows, and you'll share between your incognito windows, but you won't share information between normal an incognito.