Skip to content

AutoRotate – Ubuntu Installation Instructions

These are the instructions for installing the autorotate script on Ubuntu laptops using a prepackaged binary. If you are not using Ubuntu, then follow the general installation instructions.

Installation Instructions (Ubuntu Lucid Lynx)

  1. Make sure you have a working accelerometer that is reading the proper orientation.
  2. Add my ThinkPadX61T PPA repository by appending the following line to the end of the /etc/apt/sources.list file:
    deb lucid main
  3. Update apt-get’s package list:
    sudo apt-get update
  4. Install the script and necessary packages:
    sudo apt-get install wacom-tools python-xrandr autorotate
  5. You can have the damon to start with GDM, so it will be available to all users, even during login. This is done by adding the following line to the end of the /etc/gdm/Init/Default file before the exit 0 command:
  6. Restart GDM to start the script:
    sudo /etc/init.d/gdm restart
  7. Swivel down your screen into the tablet mode, and tilt it at around 45 degrees to test if everything is working.
  8. Follow the general instructions for setting up buttons for manual rotation.


Leave a comment
  1. Dan St.Andre / Jan 28 2010

    I am desparate for help getting Karmic to work adequately on my tablet-PC. From all of my internet research, you seem to have the most extensive handle on what to do and how to do it. I have no desire to profit from these efforts beyond a working tablet. Please tell me there is some way that you are able to help me to help myself.
    My troubles extend from total failure of “sleep” and “hibernate” to issues with almost everything “tablet” (rotate, stylus, blue-keys, extra keys and buttons) and the X6-Ultrabase(tm) and ultra-bay devices.
    Today I fetched the parts for your autorotate and I will work to deploy that tonight.
    My next most urgent “need” is for “sleep” and “hibernate” to work. This is coupled with the need to sort out the multi-boot aspects of GRUB2.
    I recently loaded Karmic onto my EmperorLinux Raven Tablet (Lenovo Thinkpad X61 Tablet). I replaced the as-built HDD with a new and larger drive and did a cold install of v9.10. Previously I used the Hardy (v8.04.3 LTS) edition of Ubuntu.

    Thanks in advance,
    ~~~ 0;-Dan

    PS/ Using Karmic and Firefox 3.5.7, I had trouble with navigation from your “projects” menu. Items would drop down, but would vanish before I could make a selection. ~~~ 0;-/

  2. Karol Krizka / Jan 31 2010

    For me, hibernate and sleep worked out of the box, without any problems, on Ubuntu Karmic. What kind of graphics card do you have? Those are usually the problem.

    Also, to get to the project list. Just click the “Projects” link and forget the drop down that comes. I’ll try to fix the drop down later though.

  3. Gaurav / Feb 22 2010

    well i finally got my screen to rotate but the problem is that once the screen is rotated the mouse messes up. up becomes down and right key becomes left.

    so if i have to point to applications (top left corner) on my desktop i have to actually move my stylus to right bottom corner.

  4. Karol Krizka / Feb 24 2010

    Can you run the script from command line and let me know what messages it prints out?

    It might be a problem with wacom tools not detecting the devices, a known problem in Ubuntu Karmic. But apparently it was fixed for the next version of Ubuntu. For now, you can fix it by following these instructions: Touch

    • wirry / Jun 17 2010

      ´xinput list´ is the command you are looking for, which prints out the following here:

      ⎡ Virtual core pointer id=2 [master pointer (3)]
      ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
      ⎜ ↳ TPPS/2 IBM TrackPoint id=10 [slave pointer (2)]
      ⎜ ↳ Serial Wacom Tablet eraser id=12 [slave pointer (2)]
      ⎜ ↳ Serial Wacom Tablet id=13 [slave pointer (2)]
      ⎣ Virtual core keyboard id=3 [master keyboard (2)]
      ↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
      ↳ Power Button id=6 [slave keyboard (3)]
      ↳ Video Bus id=7 [slave keyboard (3)]
      ↳ Sleep Button id=8 [slave keyboard (3)]
      ↳ AT Translated Set 2 keyboard id=9 [slave keyboard (3)]
      ↳ ThinkPad Extra Buttons id=11 [slave keyboard (3)]

      and another hint:

      I set the suid-flag to setkeycodes. Don’t know if this is needed if using auto-rotate (which doesn’t work ANY time here…sometimes it does, sometimes it doesn’t) but its very useful when using manual-rotate only.

      If i press the rotate-button beneath the display it rotates the screen, my stylus (i replaced “stylus” with “Serial Wacom Tablet” – see above) and the little “d-pad”. Just great :)

      • Karol Krizka / Jun 20 2010

        The “xsetwacom –list” does the same thing, but limits the results to wacom devices (which is what I want). I added this in version 0.4.1 and it works with Ubuntu Lucid, so you no longer have to manually change “stylus” to “Serial Wacom Tablet”.

        After looking at some other scripts, xinput might be useful for fixing the rotated coordinates. This might make it possible to skip setkeycodes and do everything without requiring root access.

        As for problems with auto-rotate, I fixed a few bugs recently. You might want to check the latest git:

  5. ali / Aug 7 2010

    I have the x61 tablet which is working perfect now thanks to your excellent post. I am wondering how can i detect if my tablet has finger touch features. When i received this tablet i seem to remember using my finger touch under windows vista, but i am not sure anymore. Any ideas and once again thanks for the great tutorials and excellent work

    • Karol Krizka / Aug 16 2010

      Hi ali,

      I am not sure how to detect if you have finger-touch capability inside your X61t. But I think that it is listed as an extra wacom input device. Run the following command to see what wacom devices you have:
      xsetwacom list

      You should also check out ThinkWiki for more information:

  6. pugwash / Dec 22 2010

    KK, thanks so much for your work on this. Unfortunately I haven’t managed to get it working yet (Linux Mint 10 Julia). I am new to Linux, so perhaps I am doing something stupid. Following instructions at

    My first problem:

    $ sudo apt-get install python-glib python-dbus python-xrandr autorotate
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    E: Unable to locate package python-glib

    And, perhaps not surprisingly, trying to test manually:

    $ sudo sh normal
    No protocol specified
    Can’t open display :0
    No protocol specified
    Failed to open Display .
    No protocol specified
    Failed to open Display .
    No protocol specified
    xmodmap: unable to open display ‘:0’

    By the way:

    $ xsetwacom list
    Serial Wacom Tablet stylus STYLUS
    Serial Wacom Tablet eraser ERASER

    • Karol Krizka / Dec 26 2010

      Hi pugwash,

      About the first problem, Mint probably has a different names for the required packages or it does not include them at all. Since I don’t use Mint, I can’t help you with that.

      For the second problem, the is not written by me. But it seems that your terminal is having trouble communicating with Try running “sudo xclock” and see what happens.

      • pugwash / Dec 30 2010

        $ sudo xclock
        (displays the clock)

        Traceback (most recent call last):
        File “/usr/local/bin/”, line 24, in
        from libautorotate import *
        File “/usr/local/lib/python2.6/dist-packages/”, line 9, in
        from xrandr import xrandr
        ImportError: cannot import name xrandr

  7. pugwash / Jan 7 2011

    python-xrandr is already installed.

    python-glib is missing.
    I don’t know how to get it. Launchpad says,
    “pyglib does not have any download files registered with Launchpad.”
    Maybe I should try to compile it from here?

    Meanwhile I have written a bash script to rotate manually, which is working for me. It uses xrandr (and xsetwacom), although I’m not convinced that sub-pixel rendering is working correctly, as fonts look slightly fuzzy at 180-degrees rotation. Do you have slightly fuzzy text on your screen at 180-degrees rotation?

Trackbacks and Pingbacks

  1. AutoRotate 0.3 Released | Karol Krizka
  2. AutoRotate 0.4 – The not-allowed-to-own-the-service-“net.krizka.autorotate” Release | Karol Krizka
Leave a comment