Department of Computing Imperial College
Q&A on X-Windows

Is it possible to switch the left and right mouse buttons (for left hand use)?
Is there a way to change the speed of the mouse?
Is there a way of finding out which fonts are available on the system?
How can I install some additional fonts?
How can I adjust the size of text on the screen?
Is there a way I can convert a postscript file to gif or jpeg?
Is there a utility that will take anything displayed on the screen and convert it to an image file?
Why have I been logged out without warning?


Is it possible to switch the left and right mouse buttons (for left hand use)?

Try the following command taken from the manual page for "xmodmap"...

xmodmap -e "pointer = 3 2 1"

Is there a way to change the speed of the mouse?

The command xset can be used to modify the mouse "acceleration" and "threshold".

Is there a way of finding out which fonts are available on the system?

It depends on what type of font you are referring to. X windows fonts can be listed/browsed using the command...

xlsfonts

or

xfontsel

For other types of font you would need to look through the directories where the fonts are stored.

How can I adjust the size of text on the screen?

With the mouse cursor located within an xterm window, hold down the Control key and the right mouse button. This will bring up a menu from which you can select font sizes.

Alternatively, a command to open a window with a larger font size is:

xterm -font 10x20 &

You can try selecting other sizes by putting different numbers in, but some combinations will give errors.

See also Customising Xterms.

How can I install some additional fonts? Top of page

In order to make additional fonts available to the system....

Firstly, you need to setup a font directory containing the fonts...

1. Place the fonts in a directory in your home directory (eg: ~/fonts). The fonts will typically end with an extension of .pcf or .bdf. There may also be a file called fonts.alias that contains "aliases" for some of the commands.

2. Run the command: mkfontdir within that directory - this creates an index file mapping the font names into filenames for all the fonts in that directory.

3. Make sure that the directory (and all the parent directories) are publically accessible, and that the files in the directory are world readable.

eg: Run the commands...

	chmod o+x directorynames
	chmod o+r filenames
Then when you wish to use the fonts run the commands
	xset +fp directoryname
	xset fp rehash

(directoryname should be the full path to the directory).

Is there a way I can convert a postscript file to gif or jpeg? Top of page

Ghostscript (the GNU postscript interpreter) can generate gif images:

gs filename

gs -h will display a summary of ghostscript's options.

The ghostview program provides an X11 user interface for the ghostscript interpreter. Ghostview and ghostscript function as two cooperating programs. Ghostview creates the viewing window and ghostscript draws in it.

ImageMagick's convert tool can also do pretty much anything you want to an image. man convert for further details, but:

convert something.ps something.jpg

...will probably do what you expect.

Is there a utility that will take anything displayed on the screen and convert it to an image file?

There are three methods:

1. Use software called xv which will capture any part of the screen.

Type:

xv &

When the xv window appears on the screen, click the right mouse button over it to bring up a control panel. Click the left mouse button on "grab" and then move the + to the top left point of the area you want to capture, hold the left mouse button down and drag to the bottom right of the area you want to capture. Let go the mouse button.

You can then click the left mouse button on save and then choose your format (PostScript is best if you want to print - the choice of graphic format would depend on what you want to do with the image). xv can do lots of other things like cropping, resizing and colour changing. See the manual page for more details.

2. This method creates a smaller file therefore is less likely to cause problems in printing, but it can only be used to capture a COMPLETE X-window.

3. Use import, another part of the ImageMagick suite. man import for more details.

Why have I been logged out without warning? Top of page

A few possibilities...

© CSG / 1999