rhl24.htm

来自「linux的初学电子书」· HTM 代码 · 共 2,490 行 · 第 1/5 页

HTM
2,490 行
字号
<BR>

<P>You should take the following steps to convert this .xinitrc file into one for using OpenWindows:

<BR>

<UL>

<LI>Change the reference to your window manager to either olwm or olvwm depending on which window manager you want to use.

<BR>

<BR>

<LI>Ensure that the /usr/openwin/bin directory is in your path.

<BR>

<BR>

<LI>You need an environment variable, OPENWINHOME, to be set to the directory where the files for your openwin system will reside. This variable is usually set to /usr/openwin when you log in.

<BR>

<BR>

<LI>Copy the .xinitrc file into .xsessionrc file if you are going to use xdm.

<BR>

<BR>

</UL>

<P>There are other optional files you can create in your $HOME directory, depending on which version of olwm or olvwm you use:

<BR>

<UL>

<LI>.openwin-init

<BR>

<BR>

<LI>  This file is used to initialize your desktop when you start OpenWindows with olwm or olvwm. A sample .openwin-init file is shown in Listing 24.2. This sample file shows how two xterms and one clock application are started every time you start a 
session. OpenWindows looks at a file called .openwin-init in your home directory. If .openwin-init is not found in the home directory, OpenWindows looks in the $OPENWINHOME/lib directory. The .openwin-init file contains a list of applications to start by 
default.

<BR>

<BR>

</UL>

<P>

<FONT COLOR="#000080"><B>Listing 24.2. A sample </B><B>.</B><B>openwin-init</B><B> file.</B></FONT>

<BR>

<PRE>

<FONT COLOR="#000080">#!/bin/sh

#

# Created by 'xtoolplaces' on Fri Dec 9 23:10:23 1994

#

/usr/bin/X11/xterm -sb -sl 500 -j -ls -fn 7x14 -geom 82x24+45+52 &amp;

clock -Wp 4 5 -Ws 172 52 -WP 224 533 +Wi &amp;

xterm -e /bin/bash -geom 80x24+103+89 &amp;</FONT></PRE>

<UL>

<LI>.openwin-menu*

<BR>Look in $OPENWINHOME/lib (normally /usr/openwin/lib) for this and other similarly named (openwin-menu-s, openwin-menu-d, and so on) files without the leading period (.). We will discuss these files in the &quot;Environment Variables&quot; section later 
in this chapter.

<BR>

<BR>

<LI>.Xdefaults

<BR>The .Xdefaults file applies to OpenWindows as well. You can put X Window resource specifications in here. In particular, it is a good idea to include at least

<BR>

<BR>

</UL>

<PRE>

<FONT COLOR="#000080">OpenWindows.FocusLenience: true

*Input: TRUE</FONT></PRE>

<P>These enable non-ICCCM-compliant programs to receive input even if they forget to ask for it.

<BR>

<BLOCKQUOTE>

<BLOCKQUOTE>

<HR ALIGN=CENTER>

<BR>

<NOTE>props, the program that runs when you select Properties from the default root menu under olwm or olvwm, writes your choices into .Xdefaults.

<BR>Don't put comments in .Xdefaults, because props deletes them.</NOTE>

<BR>

<HR ALIGN=CENTER>

</BLOCKQUOTE></BLOCKQUOTE>

<BLOCKQUOTE>

<BLOCKQUOTE>

<HR ALIGN=CENTER>

<BR>

<NOTE>Note that the mouse speed for OpenWindows is best set in your .xinitrc with xset m. See the man page for xset (man xset and xset -help) for more information. Do not use the .startup.ps file for setting the mouse speed as suggested by some texts. This 
is because the .startup.ps method can cause more problems if not used correctly.</NOTE>

<BR>

<HR ALIGN=CENTER>

</BLOCKQUOTE></BLOCKQUOTE>

<P>Start your program up with the startx support. See Figure 24.1 for what you should see when you start OpenWindows.

<BR>

<P><B> <A HREF="24rhl01.gif" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/24rhl01.gif">Figure 24.1. The </B><B>Xterm</B><B> in OpenWindows.</A></B>

<BR>

<BR>

<A NAME="E69E309"></A>

<H4 ALIGN=CENTER>

<CENTER>

<FONT SIZE=4 COLOR="#FF0000"><B>SELECT and MENU</B></FONT></CENTER></H4>

<BR>

<P>In OpenWindows (and Sun Workstations, for that matter), the left and right buttons on a mouse are referred to as SELECT and MENU, respectively. Clicking the SELECT button in a window selects a window. Clicking the MENU button in a window displays any 
menu for that application.

<BR>

<BLOCKQUOTE>

<BLOCKQUOTE>

<HR ALIGN=CENTER>

<BR>

<NOTE>If you have a three-button mouse, the middle button is called the ADJUST button. You can simulate an ADJUST button on a two-button mouse by clicking both buttons together.</NOTE>

<BR>

<HR ALIGN=CENTER>

</BLOCKQUOTE></BLOCKQUOTE>

<BLOCKQUOTE>

<BLOCKQUOTE>

<HR ALIGN=CENTER>

<BR>

<NOTE>The Shift-Button1 combination is also ADJUST, and Ctrl-Button1 is also MENU. These two combinations are useful if you have a one-button mouse.</NOTE>

<BR>

<HR ALIGN=CENTER>

</BLOCKQUOTE></BLOCKQUOTE>

<BR>

<A NAME="E68E190"></A>

<H3 ALIGN=CENTER>

<CENTER>

<FONT SIZE=5 COLOR="#FF0000"><B>Working Within OpenWindows and </B><B>olwm</B></FONT></CENTER></H3>

<BR>

<P>Let's examine the borders on an Xterm in OpenWindows in greater detail. (See Figure 24.2.) These borders are drawn by olwm and have special functionality.

<BR>

<P><B> <A HREF="24rhl02.gif" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/24rhl02.gif">Figure 24.2. OpenWindows borders.</A></B>

<BR>

<P>The resize handles (buttons) are the indentations on each window. You can resize a window by pressing and holding SELECT over any of the resize corners and then dragging the mouse to the new location.

<BR>

<P>Releasing the mouse button sets the new size of the window. If you hold down the Ctrl key while you are dragging, the resize operation is constrained to resize vertically or horizontally, depending on which direction you move first.

<BR>

<P>The window button is the small box with a downward-pointing triangle near the left end of the title bar. Clicking MENU over the window button brings up the window menu. Clicking SELECT over the left mouse button on the window button executes the window 
menu's default action. This usually closes the window into an icon. You can change the window menu's default action by holding down the Ctrl key while manipulating the window menu.

<BR>

<P>An icon represents a closed window. You can still do most of the same operations as with an open window. Moving and selecting icons with SELECT and ADJUST is exactly the same as for open windows. A similar version of the Window menu is available on an 
icon by pressing MENU. Double-clicking SELECT opens the icon. Icons cannot be resized.

<BR>

<P>You can select a group of windows and icons by using the left or middle mouse buttons over the workspace (the area of the screen outside of all windows and icons, commonly known as the &quot;root window&quot;). Pressing either SELECT or ADJUST and 
dragging the mouse defines a rubber band rectangle.

<BR>

<P>When you release the mouse button, you will be operating on the set of windows and icons enclosed by this rectangle. If you created the rectangle using SELECT, the windows and icons within will be selected, and all other objects will be deselected. If 
you used ADJUST, the objects within will have their selected state toggled, and any other windows and icons already selected will remain selected.

<BR>

<BLOCKQUOTE>

<BLOCKQUOTE>

<HR ALIGN=CENTER>

<BR>

<NOTE>Some OPEN LOOK pop-up windows have a pushpin instead of a Window button. The pin is either in or out, and you can click SELECT on the pin to change it to the other state. If the pin is out, pressing a command button inside the window executes the 
command and then dismisses (takes down) the window. If the pin is in, the window is &quot;pinned&quot; to the workspace, and it remains on the screen even after you have pressed a command button in the window. This enables you to press several command 
buttons in the same window. Pulling the pin out (by clicking SELECT over it) dismisses the window immediately.</NOTE>

<BR>

<HR ALIGN=CENTER>

</BLOCKQUOTE></BLOCKQUOTE>

<BR>

<A NAME="E68E191"></A>

<H3 ALIGN=CENTER>

<CENTER>

<FONT SIZE=5 COLOR="#FF0000"><B>Menus</B></FONT></CENTER></H3>

<BR>

<P>XView supports menus of the form shown in Figure 24.3. This is a sample menu containing options for you to choose. These menus are called pop-up menus.

<BR>

<P><B> <A HREF="24rhl03.gif" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/24rhl03.gif">Figure 24.3. The pinnable Workspace menu.</A></B>

<BR>

<P>Pop-up menus are operated using the MENU mouse button. There are two methods of operating with an OPEN LOOK menu: the click-move-click method and the press-drag-release method. You choose either method by clicking the MENU button (pressing and releasing 
it quickly) or by pressing it down and holding it.

<BR>

<P>If you click the MENU button, a menu pops up and will stay up indefinitely. To continue operating the menu, click the MENU button over a menu item. To dismiss the menu, click the MENU button on an area of the screen outside the menu. To operate menus in 
press-drag-release mode, press the MENU button and hold it down while you move the mouse. The menu remains on the screen as long as you hold down the MENU button. To execute an action, move the pointer over a menu item and release the mouse button. To 
dismiss the menu, move the pointer outside the menu and release the MENU button. Some menu items have a submenu. This is indicated by a right-pointing triangle at the right edge of the item. To activate a submenu, click on the item (in click-move-click 
mode) or move the pointer to the item and then move toward the right edge of the menu (in press-drag-release mode).

<BR>

<P>Some menus have pushpins. If a menu has a pushpin, it will initially be in the &quot;out&quot; state. If you click on the pin (in click-move-click mode) or move over it and release (in press-drag-release mode), you will pin the menu to the workspace. 
The menu will remain on the screen indefinitely, and you can execute commands from it by clicking on its items. To remove the menu, move over the pin and click SELECT on it.

<BR>

<BR>

<A NAME="E69E310"></A>

<H4 ALIGN=CENTER>

<CENTER>

<FONT SIZE=4 COLOR="#FF0000"><B>The Workspace Menu</B></FONT></CENTER></H4>

<BR>

<P>Pressing MENU over the workspace brings up the Workspace menu. This menu is customizable, but it typically contains at least the following items. The arrows to the right of any item indicate a submenu for the displayed item. (See Figure 24.3.)

<BR>

<UL>

<LI>Shells This item opens up another submenu with shells to choose from, including color terminals, X Terminals, VT100 emulator, and other assorted shells. (See Figure 24.4.) You can also pin this menu to your desktop. Clicking the MENU button on the menu 
brings up another submenu enabling you to resize this menu.

<BR>

<BR>

</UL>

<P><B> <A HREF="24rhl04.gif" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/24rhl04.gif">Figure 24.4. The Shell selections from the main </B><B>menu.</A></B>

<BR>

<UL>

<LI>Editors This item lets you select many types of editors, including Textedit, the standard OpenWindows text editor. See Figure 24.5 for a view of the Textedit.

<BR>

<BR>

</UL>

<P><B> <A HREF="24rhl05.gif" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/24rhl05.gif">Figure 24.5. The </B><B>Textedit</B><B> utility.</A></B>

<BR>

<P>The Cut utility can be used to cut and paste sections between files. You can access any of the menu items by using the SELECT button on any of the menu items.

<BR>

<UL>

<LI>Tools This opens up the File Manager, manual reader, calculator, spreadsheet, and other assorted items. (See Figure 24.6.)

<BR>

<BR>

</UL>

<P><B> <A HREF="24rhl06.gif" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/24rhl06.gif">Figure 24.6. The File Manager utility.</A></B>

<BR>

<UL>

<LI>Games This item has a submenu that enables you to invoke games. Check it out.

<BR>

<BR>

<LI>Utilities This item has a submenu that contains several utility functions for the workspace, including Refresh (redisplay all windows on the screen), Lock Screen, and Save Workspace.

<BR>

<BR>

<LI>Properties This item brings up the Workspace Properties window, which enables you to view and customize settings of the OpenWindows environment.

<BR>

<BR>

<LI>X11 programs This item brings up a very long menu of all the X11 programs in /usr/bin/X11.

<BR>

<BR>

<LI>XView programs This item brings up a very long menu of all the X11 programs in /usr/bin/openwin.

<BR>

<BR>

<LI>XV 3.00 This brings up the program that I used to capture all the screens for this book.

<BR>

<BR>

<LI>The Window menu This lets you choose any window on your desktop as your active window.

<BR>

<BR>

<LI>Screen saver option This item lets you select a screen saver for your session. The Lock screen item is similar to screen saver except that it requires your password to restore the desktop.

<BR>

<BR>

<LI>Exit This selection shuts down all applications and exits the windowing system. A confirmation notice appears first to give you a chance to cancel the operation.

<BR>

<BR>

</UL>

<BLOCKQUOTE>

<BLOCKQUOTE>

<HR ALIGN=CENTER>

<BR>

<NOTE>In the menu for a window, you will see two selections: Close and Quit. The Close selection closes the window into an icon, but the application for that window is not terminated. The Quit selection actually terminates the program and gets rid of the 
window.</NOTE>

<BR>

<HR ALIGN=CENTER>

</BLOCKQUOTE></BLOCKQUOTE>

<BR>

<A NAME="E68E192"></A>

<H3 ALIGN=CENTER>

<CENTER>

<FONT SIZE=5 COLOR="#FF0000"><B>Configuring Menus for OpenWindows</B></FONT></CENTER></H3>

<BR>

<P>Look in $OPENWINHOME/lib (normally /usr/openwin/lib) for the file openwin-menu and other files of the form openwin-menu-*. Copy these files into your home directory with a period in front of them. For example, copy openwin-menu as .openwin-menu.

<BR>

<P>The .openwin-menu file is used to set up your workspace menu. Look at Listing 24.3 for this file.

<BR>

<P>

<FONT COLOR="#000080"><B>Listing 24.3. The default </B><B>.</B><B>openwin-menu</B><B> file.</B></FONT>

<BR>

<PRE>

<FONT COLOR="#000080">#

# @(#)openwin-menu 23.15 91/09/14 openwin-menu

#

# OpenWindows default root menu file - top level menu

#

&quot;Workspace&quot; TITLE

&quot;Shells &quot; MENU $OPENWINHOME/lib/openwin-menu-s

&quot;Editors &quot; MENU $OPENWINHOME/lib/openwin-menu-e

&quot;Tools &quot; MENU $OPENWINHOME/lib/openwin-menu-t

&quot;Games &quot; MENU $OPENWINHOME/lib/openwin-menu-g

&quot;Utilities &quot; MENU $OPENWINHOME/lib/openwin-menu-u

#&quot;Slingshot Examples &quot; MENU $OPENWINHOME/lib/openwin-ss-ex

#

#&quot;UIT Examples &quot; MENU $OPENWINHOME/lib/openwin-uit

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?