X Windows in UNIX:X-Utilities,Startup and Motif and X.
X-Utilities
Just as Unix system provides a command repertoire, X also has a suite of commands that provide some utilities. It is instructive to see the output for the following commands:
1. showrgb: Shows the colours that can be generated.
2. xcalc: Gives a hand hand calculator.
3. xclipboard: gives a clipboard to cut and paste.
4. xclock: Gives a clock running the time of the day.
5. xfontsel: Lists the fonts and font names.
6. xhost: Lists the hosts.
7. xload: Displays load on the system.
8. xlsfonts: Lists the fonts on the system.
9. xmag: Displays a magnified image of a part of the screen. 10 xman: Opens on line manual pages.
11 xpr: prints the image created by xwd.
12 xrdb: Loads resource setting in active database.
13 xset: Sets display, key board or mouse preferences. 14 xterm: emulate a character terminal.
15 xwd: stores a screen image.
16 xwininfo: Displays the window information.
The xrdb command has several options. Use it as follows:
xrdb -query ..........this gives the resources defined for X-server.
xrdb -load ........use it to load new resource information (deleting old resource information).
xrdb -merge ....... merges new resource information with the existing. xrdb -remove ..... removes the existing resource information.
( Note that .Xdefaults has the list of current resources.)
Startup
In this section we shall discuss the support offered for startup by .Xsessions, .Xdefaults files and .xinitrc files.
.Xsessions and .Xdefaults files: These files are usually located under X11 directory. On systems that employ xdm (the display manager) one can set up a sessions file as
.Xsessions file to launch favorite applications on logging in. This may be with commands like:
xterm -sb & (For launching a terminal with a scroll bar) xclock & (For launching a clock)
xterm -iconic (For launching an iconised terminal)
The .xdefaults file is utilized to select options for customization of applications display. For instance, one can choose the background colour for clock display, font size for character display and its colour by choosing an appropriate terminal foreground. A typical file may be as shown below:
! The exclamation sign identifies that this is a comment.
!
! Turn on the scroll bar XTerm*scrollBar: True
! Select a font size XTerm*Font: 10x20
! Lines to save on scroll XTerm*saveLines: 100
! Mouse control to determine active window Mvm*keyboardFocusPolicy: Pointer
One can load this file using the command
xrdb -load $HOME/.Xdefaults
.xinitrc files: Usually xinit starts the X-server on the host. The xinit command may be initiated from .cshrc (or .xinitrc or some other log in startup file) as one logs in. The
.xinitrc may even launch a user's favourite applications like a browser, mail and a clock, etc. Some parts of my .xinitrc file are displayed below:
if [ -f ${HOME}/.Xdefaults ]; then xrdb -load ${HOME}/.Xdefaults else
xrdb -load /usr/local/X11/lib/X11/Xdefaults fi
echo `hostname` > ${HOME}/.display.machine
echo `date +"seit: "%H.%M` >> ${HOME}/.display.machine chmod a+r $HOME/.display.machine
echo `hostname` > ${HOME}/.display.host xclock -g 85x76+1064+743 -bw 0 &
#xsetbg background3.gif
#xsetbg test2.gif
#xsetbg fujisun.gif xsetbg marefoal.gif
/home/marco/bin/netscape/netscape -iconic&
xterm -g 80x10+0+0 -bw 5 -C -sb -bg MediumTurquoise -fg black +vb -fn 9x15 - iconic -fn fi xterm -g 80x10+50+50 -bw 5 -C -sb -bg MediumTurquoise -fg black +vb
-fn 9x15 -iconic -fn xterm -g 80x20+210+210 -bw 5 -sb -bg SeaGreen -fg white -vb – fn 9x15 -iconic -fn fixed -T exec fvwm
~/clear_colormap -f /dev/cgsix0 logout
Motif and X
Motif seems to be currently the most favoured X-Windows interface on Unix-based systems. This helps in some respect, as all vendors tend to use the Motif library. Technically mwm, the Motif WM, is yet another application running on the X-server. The
.mwmrc file can be used in these systems. Applications developed using the Motif library give a common look and feel just as the Windows does it for a PC.
Note that sometimes a user may have to copy the system's mwmrc file to user home directory to get the .mwmrc file. It is a good idea to take a peek at this file to see how the window (and its border), the mouse or arrow button roles bindings are defined. Below we show settings that one may find explanatory:
Buttons DefaultButtonBindings
{
<Btn1Down> icon|frame f.raise
<Btn2Down> icon|frame f.post_menu
<Btn2Down> root f.menu DefaultRootMenu
}
One may be able to customise a menu using f.exec as shown below. f.exec takes an argument which may run a X-utility.
Menu PrivateMenu
{
"Tools" f.title
"ManPages" f.exec "xman &" "Cal" f.exec "xcalc &"
"Mail" f.exec "xterm -e Mail &"
}
Comments
Post a Comment