X11

Running an X11 program on your display under another user

Suppose you're logged in as user1 and you want to run another program (xclock for example) as otheruser. You need to grant that other user the rights to your display and this is done with the program xauth. Take the following steps:

  1. Type xauth extract /tmp/myxauth :0
  2. Give everyone rights: chmod 644 /tmp/myxauth
  3. Logged in as otheruser, type xauth merge /tmp/myxauth and then to test xclock

A clock should appear. user1 should now remove the temporary file containing the so-called magic cookie with which anyone can start programs on the display of user1:

  [user1@localhost] $ rm /tmp/myxauth

Make the Caps Lock key function as an extra Escape

There are several ways to do this. For KDE 4, you can use the GUI. Go to System Settings -> Input Devices. On the left, select Keyboard. Select the third tab "Advanced". Select "Configure keyboard options". Expand the option "Caps Lock key behavior" and check "Make CapsLock an additional ESC".

There's also a solution based on Xmodmap. Create a file called .Xmodmap in your home directory. It should contain the following lines:

  remove Lock = Caps_Lock
  keysym Escape = Caps_Lock
  keysym Caps_Lock = Escape
  add Lock = Caps_Lock

Or alternatively to just use Caps Lock as Escape, on the commandline:

  $ xmodmap -e "remove Lock = Caps_Lock" -e "keysym Caps_Lock = Escape"

To start this automatically with your environment:

Bind multimedia keys

To make extra "multimedia" keys work that some keyboards have:

  1. Catch keycodes with xev
  2. Map keycodes to functions like XF86AudioMute, using Xmodmap
  3. Configure window manager to run appropriate command. In XFCE, edit the file
    /usr/share/xfwm4/themes/default.keys/keythemerc

In Gnome, this isn't necessary at all. Just go to Menu, Desktop Preferences, Keyboard Shortcuts.

I'm in Germany with this crazy keyboard

Does your keyboard start with QWERTZ instead of QWERTY? No fear, just whip up a terminal and type:

  $ setxkbmap us

To roll back and reset stuff for your German friends, type:

  $ setxkbmap de