Tablet PC

From ArchWiki

Jump to: navigation, search

Here are some hints for getting Arch Linux working on your tablet PC. These instructions contain information for getting the stylus and screen rotation to work properly on a tablet PC.

Contents

Stylus

First install the linuxwacom package. You can get this package from the AUR.

Then add the following lines to the ServerLayout section of your Xorg configuration file (/etc/X11/xorg.conf).

InputDevice    "stylus" "SendCoreEvents"
InputDevice    "eraser" "SendCoreEvents"
InputDevice    "cursor" "SendCoreEvents"

And add the following sections to the file:

Section "InputDevice"
    Identifier     "stylus"
    Driver         "wacom"
    Option         "Device" "/dev/ttyS0"
    Option         "Type" "stylus"
    Option         "ForceDevice" "ISDV4"
    Option         "Button2" "3"
EndSection

Section "InputDevice"
    Identifier     "eraser"
    Driver         "wacom"
    Option         "Device" "/dev/ttyS0"
    Option         "Type" "eraser"
    Option         "ForceDevice" "ISDV4"
    Option         "Button2" "3"
EndSection

Section "InputDevice"
    Identifier     "cursor"
    Driver         "wacom"
    Option         "Device" "/dev/ttyS0"
    Option         "Type" "cursor"
    Option         "ForceDevice" "ISDV4"
EndSection

Screen Rotation

To enable rotation capabilities (xrandr), add the following option to the Screen section of the xorg.conf file.

Option         "RandRRotation" "on"

Save the file and restart the xserver for changes to take effect.

Script for Screen Rotation

The following script will rotate the display 90 degrees clockwise every time it is executed.

Create a new file called rotate.sh:

#!/bin/bash

#### rotate.sh - A script for tablet PCs to rotate the display.

## This software is licensed under the CC-GNU GPL.
## http://creativecommons.org/licenses/GPL/2.0/

## http://wiki.archlinux.org/index.php/Tablet_PC
## REQUIRES: linuxwacom (http://linuxwacom.sourceforge.net/)
 
#### Function(s)
function set_normal {
xrandr -o normal
xsetwacom set "stylus" Rotate 0
xsetwacom set "cursor" Rotate 0
xsetwacom set "eraser" Rotate 0
orientation="normal"
}

function set_right {
xrandr -o right
xsetwacom set "stylus" Rotate 1
xsetwacom set "cursor" Rotate 1
xsetwacom set "eraser" Rotate 1
orientation="right"
}

function set_left {
xrandr -o left
xsetwacom set "stylus" Rotate 2
xsetwacom set "cursor" Rotate 2
xsetwacom set "eraser" Rotate 2
orientation="left"
}

function set_inverted {
xrandr -o inverted
xsetwacom set "stylus" Rotate 3
xsetwacom set "cursor" Rotate 3
xsetwacom set "eraser" Rotate 3
orientation="inverted"
}

#### Variable(s)
orientation="$(xrandr --query --verbose | grep '(normal left inverted right)' | awk '{print $5}')"

#### Main
if [ "$orientation" = "normal" ]; then
	set_right
elif [ "$orientation" = "right" ]; then
	set_inverted
elif [ "$orientation" = "inverted" ]; then
	set_left
elif [ "$orientation" = "left" ]; then
	set_normal
fi

#### EOF

Save the file and make it executable (chmod +x rotate.sh). You can create a link to it on your desktop or panel, or link it to a keyboard shortcut or special button on your tablet.

Tablet PC Tips

Here are some extra tips for setting up your Tablet PC.

CellWriter

CellWriter is a grid-entry natural handwriting input panel. As you write characters into the cells, your writing is instantly recognized at the character level. CellWriter is available in the AUR.

Xournal

Xournal is an application for notetaking, sketching, and keeping a journal using a stylus. Xournal aims to provide superior graphical quality (subpixel resolution) and overall functionality. Xournal can be installed from the extra repository.

Note: Currently a bug prevents annotating PDF's with the binary in the extra repository. However, a patch and updated PKGBUILD exist so that you can update Xournal yourself if you need this feature. Search the forum for details.

Disable gksu Grab Mode

If you are using gksu/gksudo, you may want to disable grab mode so that you can authenticate by using the stylus to enter the password. In a terminal, run the following command:

$ gksu-properties

Change the Grab Mode to disable.

Note: This will make it possible for other X applications to listen to keyboard input events, thus making it not possible to shield from malicious applications which may be running, such as keyloggers, etc.

Gnome-screensaver

To unlock your gnome-screensaver using Cellwriter to enter your password, first start Gconf-editor:

$ gconf-editor

Under /apps/gnome-screensaver, set embedded_keyboard_command to cellwriter --xid --keyboard-only, and check the embedded_keyboard_enabled checkbox.

GDM

You can also use CellWriter with GDM. First open /etc/gdm/Init/Default as root with a text editor. Then near the bottom of the file, add the lines in bold as shown

fi
cellwriter --keyboard-only &
exit 0

You can add --window-x and --window-y to adjust the position of CellWriter accordingly. For example:

cellwriter --keyboard-only --window-x=512 --window-y=768 &
Note: You can only use CellWriter with a Plain style GDM.

Trouble-shooting

Some tips on trouble-shooting:

Wacom Drivers

These commands are useful in troubleshooting:

wacdump -f tpc /dev/ttyS0
xidump -l
xidump -u stylus

If xidump shows that your tablet's max resolution is the same as screen resolution, then your wacom driver has rescaled your wacom coordinates to the X server's resolution. To fix this, try recompiling you linuxwacom driver with:

./configure --disable-quirk-tablet-rescale

Screen Rotation

Some video drivers do not support rotation. To check if your driver supports rotation, check the output of xrandr for the list orientations:

normal left inverted right
Note: The following driver(s) are known not to support rotation: fglrx
Personal tools