Archive

Posts Tagged ‘X’

Fixing HP EliteBook ambient button

April 10th, 2013 No comments

The button that is supposed to toggle the ambient light sensor on HP EliteBooks 8440p and 8460p per default switches off the touch pad. That is because Fn+F11 (scancode 0x33), which is the ambient light button, is incorrectly mapped to KEY_TOUCHPAD_OFF (keycode 193) in kernel.

To remap the scancode to another keycode, you can use setkeycodes. An appropriate choice for a target keycode could be KEY_PROG1 (XF86Launch1, keycode 148) which can be easily reconfigured in KDE or any other desktop environment to run any custom command.

Run the following command as root to remap Fn+F11 to KEY_PROG1:

# setkeycodes e033 148

Resources:
http://www.linlap.com/hp_elitebook_8460p

Categories: Uncategorized Tags: , ,

KDE multi-monitor display settings are lost on logout

November 29th, 2012 No comments

There are quite a few bug reports on the kde bug tracking system about kde losing display settings on logout (e.g. Bug 183143). But since this problem has been present for a couple of years and is still existing in the latest version of KDE (i.e. 4.8.5 at this writing), here’s a workaround:

Add a parameter called StartupCommands to the krandr configuration file (usually located at ~/.kde/share/config/krandrrc that adjusts your display layout using xrandr on login:

[Display]
ApplyOnStartup=true
StartupCommands=xrandr --output "HDMI-0" --primary --output "VGA-0" --right-of "HDMI-0"

You also need to make sure that the command is invoked on login by setting the ApplyOnStartup parameter to true.

The actual xrandr command may of course look different, depending on the actual number and layout of screens. So YMMV!

Categories: Uncategorized Tags: , ,

Starting a minimal X

May 17th, 2011 No comments

Just because I always forget and the parameters are somewhat non-trivial, here’s how you start an xterm inside X:

startx $(which xterm) -- :0 vt01

Of course, the display name :0 is usually used by default, so you may need to use another one (:1 etc.) if you get an error like “Server is already active for display 0“. You can also select a different virtual terminal.

Note that the absolute path to xterm (or whatever application you’d like to start inside X) is essential.

Categories: Uncategorized Tags:

Granting access to X server with xhost

July 14th, 2010 2 comments

Every X server internally manages an ACL (Access Control List) of those hosts, that are allowed to connect. The server only authorizes connections from X clients, whose host is on that list and rejects access to all others. The xhost program is used to add or revert access to the X server for specified hosts. It’s also possible to specify a user and a hostname pair.

Host-based Control (xhost)

To see if access control is enabled, type xhost. It displays the current ACL:

$ xhost
access control enabled, only authorized clients can connect
SI:localuser:user
SI:localuser:gdm
SI:localuser:root

If the access control is disabled, it prints:

$ xhost
access control disabled, clients can connect from any host

To disable the access control type xhost + which allows any host to access your X server. You probaly don’t want to do this because it allows the world to open windows on your screen and grab the keystrokes you type.

To enable the access control again type xhost - and only authorized clients/hosts are allowed to do the things mentioned above.

A simple example

Now let’s do something useful, e.g. grant another user on the local machine access to our X server. It’s pretty easy:

$ xhost +SI:localuser:anotheruser
localuser:anotheruser being added to access control list

And after that, anotheruser should show up in the ACL:

$ xhost
access control disabled, clients can connect from any host
SI:localuser:anotheruser
SI:localuser:user
SI:localuser:gdm
SI:localuser:root

To revoke the access right for anotheruser, use

$ xhost -SI:localuser:anotheruser
localuser:anotheruser being removed from access control list

For granting access to users on different hosts, have a look at the xhost manpage or the examples provided on http://linux.about.com/library/cmd/blcmdl_xhost.htm.

Categories: Uncategorized Tags: , ,

Staring X applications through an ssh tunnel

May 9th, 2009 No comments

If you encounter the problem of being unable to start an X application through an ssh-tunnel and run into an error message similar to

Can't open display

or

RuntimeError: could not open display

you should check

  • that you used ssh -X[...] to enable X11 forwarding when connecting to the server
  • that the xauth-package is installed correctly on your server

xauth is used to edit and display the authorization information used in connecting to an X server.

For example, after installing a minimalistic CentOS the xorg-x11-xauth package is not necessarily installed as well.

The solution is quite simple:

yum install xorg-x11-xauth

does the trick! You may have to reconnect to give xauth the opportunity to create a new authority file for you user (~/.Xauthority)

Categories: Uncategorized Tags: , , ,