X11

From Peyton Hall Documentation
Jump to navigation Jump to search

Some information about the X Window Interface (aka X11 or xorg), the system used to display a graphical interface on Unix and Linux desktops (and also used on Macs to display X11 windows from Unix or Linux machines over SSH tunnels).


Changing your window manager

The window manager is the program that helps you maintain all the programs running on your desktop. It may provide quick buttons to minimize, maximize and close the window, as well as usually has menus to help you execute programs and find different features. The default window manager for all users is KDE, since we've found it to be not only easy to use but easy to understand for new users (and yet quite powerful for those more familiar with the system too). However, if you decide you want to change your window manager you can do that.

The simplest thing to do, if for example you wish to use Gnome instead, is to select it from the login screen.

If the window manager you wish to run isn't listed on the login screen, then you'll need to call it yourself. Create a file in your home directory called .xinitrc, like this:

#!/bin/sh 
PATH=$PATH:/usr/peyton/bin
XUSERFILESEARCHPATH=/peyton/lib/X11/app-defaults/%L/%N 
export XUSERFILESEARCHPATH PATH 
xrdb -load $HOME/.Xdefaults 
if [ -f /usr/bin/startkde ] ; then 
     /usr/bin/startkde 
else 
     xterm -geometry 80x24+1+110 -fn 6x12 -sb -sl 1000 -bg black -fg white & 
     xclock -geom 85x85-300+1 & 
     xterm -geometry 80x4+1+1 -fn 6x12 -C -fg wheat -bg black -T Console 
fi
kbd_mode -a

This will exec /usr/bin/startkde if it's available, and if not it will run a "failsafe" mode with a couple xterms and no window manager at all. Replace the "startkde" lines with your own window manager, and it will be run instead.

Keep in mind that there must be at least one line in the .xinitrc file that is *NOT* backgrounded (no '&' after the command). This is because the .xinitrc file is read like a script, and when it exits it is assumed that you have closed your X session. Therefore, the window manager is usually the item that is left in the foreground (so you can select "Log Out" in the window manager, which will cause it to exit cleanly, and your X session will close). In the failsafe mode above, the Xterm in the upper left corner is the foreground process, so when it is closed your session will end.


Color issues

There's a number of things that could be affecting your color settings. A common problem is programs that only half obey the settings in your .Xdefaults files. Therefore, lines that look like '*Background: moccasin' or 'xterm*Foreground: black' may actually cause Pine to display black text on a black background. Try commenting these lines out by putting a '!' in front of them, then reload the .Xdefaults file with 'xrdb .Xdefaults'. Also see the section on Color problems in IDL.


Changing key functions (Caps, Control)

Many people prefer to swap Ctrl and Caps Lock, either because they feel it's more comfortable or started on a Sun and are more used to that layout. You can do this easily by creating (or adding) the following lines in a file called .Xmodmap in your home directory:

!
! Swap Caps_Lock and Control_L
!
remove Lock = Caps_Lock
remove Control = Control_L
keysym Control_L = Caps_Lock
keysym Caps_Lock = Control_L
add Lock = Caps_Lock
add Control = Control_L

Next, run 'xmodmap ~/.Xmodmap' to load the settings. Caps Lock and Ctrl should now be swapped, acting more like a Sun keyboard.

NOTE:

You could use any file name for this purpose, however by using the name .Xmodmap and putting it in your home directory, the next time you fire up X the display manager will load these settings for you automagically.


My mouse buttons don't seem to work!

Turn off Num Lock. Don't ask why. Just trust me. This may not be pertinent anymore, but it bit quite a few people in the past.


How do I use X11 applications in Microsoft Windows?

If you want to display the windows from an application you're running on a Linux system on your Microsoft Windows PC, you must install an X server. There are a few freely available X servers for Windows; we've usually recommended XMing in the past because it's self-contained and easy to install. You will want to download and install both the Xming and Xming-fonts packages, and the public domain releases are fine (and free -- though they appreciate donations). You will also need to configure your SSH client to forward X11 connections. If you've configured Putty, just go to Connection -> SSH -> X11 in the Putty Configuration dialog, check the box "Enable X11 Forwarding", and type :0 in the "X display location" box. Go back up to Session and save your settings.


I've installed Xming but running applications in Linux gives me errors such as "No fonts match 9x15" or "Warning: Cannot convert string to type FontStruct"

You failed to install the Xming-fonts package. Download it, install it, and restart Xming and that should fix the problem. If that still doesn't help, contact us and we'll try to help you further.


See also