📄 0115-0117.html
字号:
<HTML>
<HEAD>
<TITLE>Sams Teach Yourself Linux in 24 Hours:Using the X Window System:EarthWeb Inc.-</TITLE>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>
-->
<!-- ISBN=0672311623 //-->
<!-- TITLE=Sams Teach Yourself Linux in 24 Hours//-->
<!-- AUTHOR=Bill Ball//-->
<!-- PUBLISHER=Macmillan Computer Publishing//-->
<!-- IMPRINT=Sams//-->
<!-- CHAPTER=07 //-->
<!-- PAGES=0103-0126 //-->
<!-- UNASSIGNED1 //-->
<!-- UNASSIGNED2 //-->
<P><CENTER>
<a href="0112-0114.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0118-0120.html">Next</A>
</CENTER></P>
<A NAME="PAGENUM-115"><P>Page 115</P></A>
<P>These values tell the xpaint client to draw a vertical toolbox. If you'd like a horizontal
toolbox instead, you can resize the toolbox, note the dimensions shown by the window
manager during the resize operation, and use the new settings to change the initial size of the
toolbox in its default resource settings file, for example:
</P>
<!-- CODE //-->
<PRE>
...
! The top level operation/toolbox menu
!
XPaint.width: 702
XPaint.height: 122
...
</PRE>
<!-- END CODE //-->
<P>For details about X resources, see the X man page. For details about different
client resources, see the program's manual page or other documentation.
</P>
<P>
<CENTER>
<TABLE BGCOLOR="#FFFF99">
<TR><TD><B>
CAUTION
</B></TD></TR>
<TR><TD>
<BLOCKQUOTE>
Make sure your changes reflect your supported screen size, or programs
might start off-screen, or with windows too large to be useful. Always use
the exclamation character for comments, and if you edit the default, or
original application resource file, copy the original settings first to a comment line.
</BLOCKQUOTE></TD></TR>
</TABLE></CENTER>
</P>
<H4><A NAME="ch07_ 15">
Changing X11 Mouse and Cursor Modes
</A></H4>
<P>When you use X11, you might want to change the way your mouse works, or switch
the order of the mouse buttons. This is especially handy if you're left-handed or if your
mouse responds differently than the desired setup. You can also change the type of cursor
used by your window manager.
</P>
<P>In order to change your root window cursor, you
need to know what cursors are available. You'll find a list of cursors in the
cursorfont.h file under the /usr/X11R6/include/X11 directory,
for example:
</P>
<!-- CODE //-->
<PRE>
...
#define XC_exchange 50
#define XC_fleur 52
#define XC_gobbler 54
#define XC_gumby 56
#define XC_hand1 58
#define XC_hand2 60
#define XC_heart 62
#define XC_icon 64
...
</PRE>
<!-- END CODE //-->
<P>As you can see, many types of cursors are listed in this file. Knowing these different
type of cursors, you can then use the xsetroot
client, or root window utility program, to set
your root cursor image, for example:
</P>
<!-- CODE SNIP //-->
<PRE>
# xsetroot -cursor_name hand1
</PRE>
<!-- END CODE SNIP //-->
<A NAME="PAGENUM-116"><P>Page 116</P></A>
<P>
This will change the root cursor to look like a right-pointing hand. If you are
left-handed, you might want to use the left-pointing
hand2 cursor!
</P>
<TABLE BGCOLOR=#FFFF99>
<TR><TD>TIME SAVER</TD></TR>
<TR><TD>
<BLOCKQUOTE>
An easy way to see all the cursors is to use the
xfd, or X11 font display, client found under the
/usr/X11R6/bin directory. Used with the -fn command-line
option, the xfd client will display the entire character set of the cursor font,
cursor, located in the
/usr/X11R6/lib/X11/fonts/misc directory.
</BLOCKQUOTE>
</TD></TR>
</TABLE>
<P>If you find the left and right mouse buttons inconvenient, you can change how these
buttons are ordered on your mouse by using the
xmodmap client, found under the /usr/X11R6/bin directory. For example, to reverse the order of your mouse buttons, you can try
</P>
<!-- CODE SNIP //-->
<PRE>
# xmodmap -e "pointer 3 2 1"
</PRE>
<!-- END CODE SNIP //-->
<P>This example, from the xmodmap manual page, might help left-handed users.
</P>
<TABLE BGCOLOR=#FFFF99>
<TR><TD>JUST A MINUTE</TD></TR>
<TR><TD>
<BLOCKQUOTE>
The xmodmap client can also be used to change or alter the keys on
your keyboard. See the xmodmap manual page for more information.
</BLOCKQUOTE>
</TD></TR>
</TABLE>
<P>You can also customize other mouse settings using the
xset, or user preference, client. For example, if you want to speed up your mouse acceleration, or how fast it travels across
the screen, you can try these settings:
</P>
<!-- CODE SNIP //-->
<PRE>
# xset m "40 4"
</PRE>
<!-- END CODE SNIP //-->
<P>If this is too fast for you, try the following:
</P>
<!-- CODE SNIP //-->
<PRE>
# xset m "4 8"
</PRE>
<!-- END CODE SNIP //-->
<P>Experiment with different settings. You can really slow down your mouse with the
xset m "0 1000" command line. See the
xset client manual page for other X11 settings you can
change, and see if some work with your system.
</P>
<H4><A NAME="ch07_ 16">
How to Copy and Paste in X11
</A></H4>
<P>Copying and pasting information in X11 involves transferring text between
terminal windows, or graphics from one X11 client to another. For example, you can use the
xmag program to select a portion of your desktop, then paste the copied graphic into an
open xpaint drawing window (see Hour 16, "Graphics Tools"). To do this, first run the
xpaint client, go to the File menu, and select New Canvas. Then start the
xmag client. You'll see a tiny corner cursor. If you click over an area of the screen you'd like to magnify, the
xmag client
</P>
<A NAME="PAGENUM-117"><P>Page 117</P></A>
<P>
will then display the selection in a window. You would then move your cursor to the
xpaint drawing window, go to the Edit menu, and select Paste. Your selected graphic will be
pasted in the xpaint window.
</P>
<P>If you're running a word processor or the command line in your terminal windows,
you can also copy and paste text between windows. Both the
xterm and rxvt terminals support copy and paste operations using your mouse cursor and mouse buttons. To copy text, you'll
need to highlight the text first. If you just want a word, double-click on the word with your
left mouse button. If you want a line of text, triple-click on the line. But if you want more
than a word or a line, you'll need to highlight regions of text.
</P>
<P>You can select text regions in terminal windows in two ways: You can move your
cursor to the beginning or end of the text, and then drag with the left mouse button held
down to highlight the selected text. You can also click at the beginning of the text with your
left mouse button, then click at the end of the text to highlight your selection. There are
also two ways to paste text into another window. One way to paste text is to use your
keyboard by holding down the Shift key, and then pressing the Insert key. The other way is to
press the middle mouse button (or the left and right mouse buttons simultaneously if you're
using a two-button mouse to emulate three buttons).
</P>
<P>You can also use the xcutsel client to copy from one window to another. When you run
this client, you'll see two buttons called "copy PRIMARY to 0" and "copy 0 to
PRIMARY." To copy text from one window to another, first highlight text in one window. Then
click on the "copy PRIMARY to 0" button. You can then click on the "copy 0 to
PRIMARY" button, then move to the window where you want to paste the text, and use either
your keyboard or mouse to paste the text.
</P>
<P>Another X11 client for copying and pasting text is the
xclipboard client. This program is especially handy for copying sections of text from messages, FAQs, HOWTOs, or
other files. Like the xcutsel client, xclipboard places the copied text into a buffer, but has the
added benefit of displaying the text, which you can then save into a file, or copy into other
windows or programs.
</P>
<P>If you'd like to do more than just copy small bits of graphics or text, you can also
capture pictures of whole windows or your desktop. The next section shows you how to
capture, save, and display pictures from your X11 desktop.
</P>
<H4><A NAME="ch07_ 17">
Capturing and Dumping X11 Window
</A></H4>
<P>You can capture pictures of windows or your entire desktop using several X11
clients included on your CD-ROM. The first is the
xwd, or X11 window dump, program. You can use this client to take snapshots of your screen, or any desired window.
</P>
<P>The xwd program is easy to use. You'll want to specify a file on the command line,
because
</P>
<P><CENTER>
<a href="0112-0114.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0118-0120.html">Next</A>
</CENTER></P>
</td>
</tr>
</table>
<!-- begin footer information -->
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -