home | tech | misc | code | bookmarks (broken) | contact | README


X11 tips

Changing keyboard layout at runtime

The setxkbmap command can change keyboard layout without restarting X:

$ setxkbmap br abnt2 # To use the ABNT2 layout

X11 runtime sets

To change sets at runtime in X11, you can use a lot of tools. Among them, xset:

$ xset dpms force off       # Turn off monitor
$ xset dpms force on        # Turn on monitor, but it still gets
                            # blank. To make images appear, type
                            # the next command:
$ xset s reset              # Reset monitor.

Discover what driver X is trying to use

Just use this command:

$ grep -B2 'Module class: X.Org Video Driver' /var/log/Xorg.0.log

Got from here.

In GNU/Linux, according to this page is is better to use lshw instead:

# lshw -c video

Enable X forwarding on Ubuntu 10.04 Lucid Lynx

By default, unencrypted X forwarding is disabled in Ubuntu GNU/Linux 10.04 Lucid Lynx. It seems that using ssh -X to allow encrypted forwarding works when using GNOME, but I had problems using it with another more basic windows manager compiled by hand (notion). I have any idea why it happened and I didn't investigate it further.

Well, according to this instructions, it was enough to modify file in /etc/gdm/gdm.schemas and change the default value of the key security/DisallowTCP from true to false and restart gdm. When login, use the xhost command and the DISPLAY environment variable to make the forwarding.

Use two touchscreen monitors

Connecting one touchscreen monitor and make the mouse point to the right position when your finger touches that might be tricky. After installing the right driver and configuring xorg.conf correctly, it works.

What about two touchscreen monitors? Setting up dual-head support is easy in xorg.conf, but how to tell system that, when the first touchscreen is touched, it should point the mouse pointer on the first monitor and the second touchscreen should point the mouse pointer on the second monitor?

Fortunately things get simpler as the time goes on... Nowadays, at least on Ubuntu 10.04 LTS Lucid Lynx, input devices are associated with events devices in /dev.

So, to discover what touchscreen is associated with each device, xxd each /dev/event* and touch the touchscreen:

# xxd /dev/event0

If you see data when you touch it, so that event device is associated with the touchscreen you just touched. Take a note about that.

Then, install the evtouch driver:

# apt-get install xserver-xorg-input-evtouch

evtouch is the driver that recognizes /dev/event* information and sets the mouse pointer for you.

After that, setup the xorg.conf as seen here. Although that example is using two Screens, it might be possible to use only one.

Then, it is likely to be working. Adjust the MinX, MinY, MaxX and MaxY for your setup.

Some references on my quest to solve this problem: