More on the X61 Tablet: Calibrating the touchscreen

January 14th, 2011

I’ve updated my tablet script for Ubuntu 10.04 to fix the calibration of the multitouch touchscreen on my X61 tablet.  (Oddly, the stylus and the finger touch seem to be completely different devices with their own calibration).  Here it is:

#!/bin/bash
# Remap the side button to bring up context menu.
xsetwacom set "Serial Wacom Tablet" Button1 "button 1"
xsetwacom set "Serial Wacom Tablet" Button2 "button 3"
# Fix the "Serial Wacom Tablet eraser" button to paste
xsetwacom set "Serial Wacom Tablet eraser" Button1 "button 2"
# Calibrate the touchscreen on multitouch X61
xsetwacom --set 'Serial Wacom Tablet touch' 'TopX' '40'
xsetwacom --set 'Serial Wacom Tablet touch' 'TopY' '86'
xsetwacom --set 'Serial Wacom Tablet touch' 'BottomX' '940'
xsetwacom --set 'Serial Wacom Tablet touch' 'BottomY' '948'
# Done

I run this script as a task when my Gnome session starts (System/Preferences/Startup Applications) and I added it to the beginning of /etc/gdm/Init/Default so that I could use the touchscreen to log in.  Since the Gnome on-screen keyboard for the login screen is too small for finger touch, I also edited /usr/share/gdm/autostart/LoginWindow/onboard.desktop to make the onscreen keyboard bigger:

Exec=onboard --size 1022x190 -x 0 -y 0

Now I can log in without the stylus!

You can get the numbers for touchscreen calibration by running:

xinput test 'Serial Wacom Tablet touch'

I did have to tweak the numbers that xinput spit out to get the best overall touchscreen response – just putting the numbers xinput showed for TopX and BottomX resulted in touch being a bit off on the right hand side of the screen.

Source: http://www.ormiret.com/?q=node/26

The chemist and the Lynx – Part 2

May 28th, 2010

I’d indented to post this a bit earlier, but I’ve been scrambling lately to recover from the premature death of both my Thinkpad X61’s AC adapter and its 320 GB Hitachi hard drive.

When it rains, it pours.

Now I’m back online with a spare drive and another fresh Ubuntu 10.04 installation.  So now it’s time to get some more stuff working nicely.

Stylus buttons

Wouldn’t it be nice to have the thumb button on the stylus bring up a menu?  That way, you could use only the stylus to navigate the desktop without having to flip it over.  Ubuntu 10.04, unfortunately, does not provide any tool to change the functions of the stylus buttons.  But that doesn’t mean it can’t be done with a script:

#!/bin/bash
# Remap the side button to bring up context menu.
xsetwacom set "Serial Wacom Tablet" Button1 "button 1"
xsetwacom set "Serial Wacom Tablet" Button2 "button 3"
# Fix the "Serial Wacom Tablet eraser" button to paste
xsetwacom set "Serial Wacom Tablet eraser" Button1 "button 2"

If you save the script above (I saved it as stylusbuttons.sh), you can tell it to be run every time you log in to your desktop using the main menu option System->Preferences->Startup Applications.

Screen rotation

Sometimes it’s nice to use the X61 as a proper tablet – with the screen folded down and the desktop rotated.  Rotating the desktop is simple enough, but the stylus doesn’t rotate with the desktop – making the rotated desktop impossible to use.  This is something I wish Ubuntu would handle automatically, but it’s also something that can be done easily with a script:

#!/bin/bash
# Won't work if the display is something other than 1024x768
# Won't rotate if external monitor is connected
orientation=`xrandr -q | grep -c 1024x768`
if [ $orientation -eq 2 ]; then
   /usr/bin/X11/xrandr --orientation right
   xsetwacom set "Serial Wacom Tablet" Rotate CW
   xsetwacom set "Serial Wacom Tablet eraser" Rotate CW
else
   /usr/bin/X11/xrandr --orientation normal
   xsetwacom set "Serial Wacom Tablet" Rotate NONE
   xsetwacom set "Serial Wacom Tablet eraser" Rotate NONE
fi

Save this as rotation.sh .  It will rotate the desktop and the stylus, leaving you with a usable system.  If you run the same script again while the desktop is rotated, it will restore the desktop and stylus to their original orientation.  If you don’t want to open the terminal window to rotate your desktop, you can use an application launcher in the Gnome panel to run the script.

Fixing the screen saver

In Ubuntu 10.04, the screensaver locks the screen by default, requiring you to enter a password to unlock the screen.  This can be rather annoying on a rotated tablet, since the screen saver does not provide an on-screen keyboard to allow you to unlock the screen.  With so many mobile devices about, you’d think this issue would have been fixed by now, but so far it’s not been done.  It’s not that the screen saver doesn’t support an on-screen keyboard; it’s just that there is no obvious way to turn it on!

Here’s what you need to do:

Install cellwriter, which you have probably already done.  If not,

apt-get install cellwriter

Then, open up gconf-editor.

gconf-editor

Open the apps folder, then click gnome-screensaver.  Make sure the box beside embedded_keyboard_enabled is checked.  Then, click embedded_keyboard_command and set its value to this:

cellwriter --xid --keyboard-only

Now you can unlock the screen with your stylus!  (And you can also curse the Gnome developers for only half-fixing a major and easily-fixable accessibility problem.)

The chemist and the Lynx – Part 1

May 12th, 2010

Longtime readers (all three of you) might have noticed that I run Ubuntu Linux on my computers.  There’s a new Ubuntu out – version 10.04 “Lucid Lynx”.  Now that my school is between semesters, I have a little time to get the new version up and running (and troubleshooted) before summer classes start.

Installation on a Thinkpad X61 Tablet

You don’t have to do it this way, but I usually back up my personal data and do a fresh install of a new operating system.  I chose the 32-bit version of Ubuntu because 64-bit Flash is still a work-in-progress at this point.  Plus, I use a few older 32-bit Windows applications under Wine for teaching, and they’re just easier to get running reliably with a 32-bit install.

As is typical with most recent Ubuntu releases, the initial install was painless.  Boot up with the CD and answer the questions.  That’s it.  All the X61 Tablet hardware that I actually use – including the pen – is functioning as soon as the installation is complete.

Essential software

The first thing you’ll want to do on any new Ubuntu system – and Lucid is no exception – is to install the usual multimedia tools.  At a minimum, you want to install the “restricted” packages:

sudo apt-get install ubuntu-restricted-extras

This will enable playback for most media files, install the freely available Microsoft web fonts, etc.  If you have a tablet like I do, you will also want cellwriter for handwriting recognition and xournal for note-taking and PDF annotation:

sudo apt-get install cellwriter xournal

Let the tweaking begin:  Fixing the new themes

Next, let’s have a look at the new Lucid desktop.  I don’t like dark desktop themes.  Therefore, I consider the default Ubuntu theme – “Ambiance” – to be an abomination.  Luckily, there’s a light version of the default theme, called “Radiance”.

Both of these new desktop themes could use some improvement.  One issue that bothered me immediately relates to active windows.  In most themes, the window that you are currently using – the “active” window – is distinguished from other visible windows by giving the title bar of the window a distinct appearance.

Here’s the default Radiance theme.

The Radiance theme, as shipped with Ubuntu Lucid 10.04

In the picture above, the terminal window (and not Firefox) is the active window, and will receive input from whatever keys you happen to press.  You can see that in an active window, the close button is orange.  You can also see that the active window is dark gray in the task bar.  These are small cues, though, and are not very useful when a lot of windows are open.

This is more minor, but the scrollbars on the Firefox window are also hard to see.

And then there’s the buttons. The window buttons (minimize, maximize, and close) have been moved to the left side … for what appears to be no good reason at all.  This might be great news for someone who is left-handed, but not for me.

I’m not a themes guru. but these details bothered me enough to hack the Radiance theme to make it more usable.  First, I borrowed some elements from the dark Ambiance theme and modified Radiance so that inactive windows would have a dark title bar and buttons, while the active window would be light.

I changed the scrollbars to match the orange-ish window close button, which makes them much easier to see and grab with the pen.

And the buttons?  Back where they belong.  The result looks like this.

Modified Radiance theme

(The active window in this screen shot is still the terminal window.)  As you can see, active and inactive windows now look different from one another.  No more confusion when transferring grades from my spreadsheet to our web-based system!

Want these modifications for your desktop? Download it here: [Modified Radiance theme – TAR archive]

To install this theme, download it, then extract the contents of the archive into /usr/share/themes.  The commands below should work on a default Lucid install

cd /usr/share/themes
sudo tar xf /home/[your user name here]/Downloads/radiance_2_3.tar

Then, select the “Radiance-2” theme from your System/Preferences/Appearance menu.

In Part 2, I’ll discuss making the stylus buttons do more interesting things

This seems appropriate

April 21st, 2010

As I watch our school’s computer network crash and burn because McAfee couldn’t be bothered to test their software before rolling out an update, I feel thankful that my laptop – where all of my teaching materials are kept – runs Ubuntu.

xkcd sums up my feelings on the whole matter rather nicely:

Holt Lake … barbecued

April 20th, 2010

Nearly four years ago, I posted about Holt Lake Bar-Be-Que, a BBQ place near Smithfield, NC.  Pretty good food.

Early this week,though, Holt Lake BBQ burned.

The restaurant was not open when the fire started at about 6 p.m. Sunday. The fire was contained to the kitchen, Smithfield Fire Department Chief Patrick Harris said.

Investigators said they believe the fire started when some fluorescent lights shorted out.

Hope they’ll be back soon…

Bless their hearts…

March 26th, 2010

So I’m browsing Fark and run across this headline:

[ARTICLE] [FAIL] In a move that will upset nobody, repressed white southerners want to declare themselves “Confederate Southern Americans” on the census. Try “hillbillies,” guys, it’s got a nicer ring

And I immediately start thinking:  “Please don’t be South Carolina… Please don’t be South Carolina…”

The South Carolina-based Southern Legal Resource Center believes that people with ancestors who were citizens of the Confederate States of America should be entitled to ethnic identity and protection [under the Civil Rights Act] since the country no longer exists.

Since I can’t really think of anything else to say, I’m just going to leave this here:

Hey y’all … watch this!

March 19th, 2010

From the department of “scientifically confirming the obvious”***, we have this shocking finding:

As the researchers expected, the skateboarders took greater risks in the presence of the attractive female, even when they knew there was a greater chance they could crash. Along with this increased risk-taking, the young men had higher testosterone levels when they performed in front of the female than when they did their jumps in front of another guy.

Hardly surprising.  But it would be unwise to underestimate the ability of men to do dumb, risky stuff in groups.  After all, the words “Hey y’all, watch this!” have rarely been yelled before attempting a safe activity.


***It is often useful to do actual research on things that seem “obvious”.

Welcome!

March 19th, 2010

Welcome to the new site!  It’s so clean … it’s so shiny.  It’s so … red.

If you’re wondering where the images in the title bar come from, that’s from a demonstration of the reaction of sodium peroxide and water.  You can watch the whole video here.

If you’re new to the site, take a look around – plenty to see here.  And I promise I’ll post more than once every three months!

Enjoy!

Literacy in the bookstore

December 19th, 2009

The children’s section of a used book store in Fayetteville stocks a series of beloved books.

Dr. Suess books.  I wonder if I can find <i>Geern Egsg nad Hma</i>?

Dr. Suess books. I wonder if I can find Geern Egsg nad Hma?

Further over on the shelf, you can find the cheap stuff.

What a barge-in!

What a barge-in!

(The really sad thing is that copies of this sign were all over the store.)

Competition

November 10th, 2009

Here’s an interesting set headlines that popped up in The State – one right after the other – in my RSS reader:

Headlines

Headlines

The message?  It’s not, apparently, that gambling is wrong.  It’s that the powers that control gambling in the state do not want competition.