X Windows in UNIX:Some Standard X-clients,Hosts and Selecting a host for Display.
Some Standard X-clients
The Unix environment provides a slew of facilities in the form of clients that seek specific services. Let us briefly enumerate these clients and describe their functionalities:
- xclock: A clock display. It is possible to have a numerical or an analog display for the current time.
- xbiff: A Berkeley support program that displays mail status with a flag up, to show the arrival of a new mail.
- xterm: It provides a user with a new terminal window. With -C option the window can receive and display console messages.
Most of these clients have options like -geometry to indicate the size of display as shown in the example below.
xclock -geometry 80x80-10+10
This command seeks to display an 80£80 pixel clock, 10 pixels away from the right-hand corner of the screen. We can choose foreground and background presentation styles. One may also choose a title for a new window as shown below and even iconise it.
xterm -foreground green -background yellow -title "My Window" xterm -iconic -title "My IconisedWindow"
One of the standard facilities all WMs provide is to cut and paste. It is usually possible to cut from any of the windows and paste it anywhere on the receiving window. This is very useful to transfer texts and images as bit maps.
Hosts
The X protocol requires to maintain a host-table in the /etc/hosts file. The machines listed in this table alone can set up a display on a host. For instance, my machine SE-0 has the following host table entries:
# Internet host table
#
127.0.0.1 localhost
172.21.36.10 SE-0 loghost
210.163.147.1 a463-2.info.kochi-tech.ac.jp a463-2 canna-server loghost 210.163.147.2 main.info.kochi-tech.ac.jp a464-1 printer-server-host 172.21.36.20 SE-P0
172.21.36.2 SE-1
172.21.36.11 SE-2
.
.
172.21.36.17 SE-10
#
The host-table entries may be modified to add or delete hosts by using the xhost
command as shown below. To add an additional host: xhost +addhostname
To delete an additional host:
xhost -deletehostname
(Caution: Not having a host name may delete all entries in the host-table)
Selecting a host for Display
With our ability to connect to a remote machine, we may run an application on a remote machine. Let us consider that we are executing the application on a host called rem_host while we are operating from a host loc host. However, if we wish to visualize the output on loc_host we shall have to choose the display to be available on loc host while the application may be generating the output for display on rem_host. This usually requires the use of X-protocol of display. We should have loc_host as well as rem_host identified in the host lists on both the machines. In this scenario it is required to set display on loc host. This is done as explained below. To begin with, let us interpret the following command:
xterm -display hostname:0.0
which will open a window on the hostname. The string :0.0 identifies the monitor and the xserver running on the hostname. Sometimes when we remote login using a telnet command, we may have to set the display from a remote computer to be on the host where we are presently logged in. This can be done by executing the following command in the window connecting to the remote machine.
setenv DISPLAY hostname:0.0
With this command executed on the remote machine we will get the application's image displayed on hostname. Note that the default, i.e. the local host is unix:0.0.
Comments
Post a Comment