HPlogo Using the X Window System > Chapter 8 Using the X Clients

Starting Clients and Non-clients

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Glossary

 » Index

Programs can run as either background or foreground processes. In any X11 terminal window, you can run only one program as a foreground process, but you can run many programs as background processes. To run a program as a background process, add an ampersand (&) to the end of the command line that starts the program.

The general syntax for the command line that starts a client is:

client [-options] [&]

An & at the end of the command line causes the client to start as a background process.

Programs can be started:

  • From the command line.

    The client name and options are typed after the command line prompt.

  • From menus.

    Refer to chapter 7 for details of how to create your own menus.

  • As part of the X startup.

    Refer to chapter 4 for information about the .x11start file.

Command-Line Options

Command-line options override all default files. If no options are specified, the client is started using resource values from the resource database, the client's app-defaults, or from defaults built into the client.

Some toolkit options are common to most clients:

-fn font

Specifies the font to use for the client.

-bg color

Specifies the background color.

-fg color

Specifies the foreground color.

-display host:display.screen

Specifies the host where the client will display its output.

-geometry width×height

Specifies the size of the window and its location.

-help

Displays an explanation of the options available for the client.

For a specific client's options, refer to the client's man page.

Options have the syntax:

- option argument

For example, the following command line starts an hpterm window with a black background and white foreground:

   hpterm  -bg  Black  -fg  White &

Specifying the Display and Screen

The default display on which a client is displayed is obtained from the DISPLAY environment variable of the system on which the client starts. It sets the host, display number, and screen number to which the client directs its output. This is typically display 0, screen 0.

Most clients have a -display option that lets you set the host, display number, and screen on which the client will display its output. The -display option has the syntax:

-display [host:display.screen]

host

The hostname of a valid system on the network.

display

The number of the display on the system on which you want the output to appear. A display can include more than one screen.

screen

The number of the screen where the output is to appear. The default is 0.

For example, executing the command:

   hpterm  -display  hpxhere:0.1 &

starts an hpterm process on the local system and displays the window on display 0, screen 1 of the hpxhere system. The window has the default size, location, and color.

© 1995 Hewlett-Packard Development Company, L.P.