1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033
|
@c $Id: x.texinfo,v 1.27 2001/06/06 18:36:04 m Exp m $
@node X, , Shell, Getting Started
@comment node-name, next, previous, up
@chapter The X Window System
@cindex X Window System
@pindex XFree86
@pindex X11R6
@flushleft
@sf{Debian}: @file{xserver-common}
@sf{WWW}: @url{http://www.xfree86.org/}
@end flushleft
@*
@noindent
The X Window System, commonly called ``X,''@footnote{Sometimes you might
see it referred to as ``X Windows,'' but this term is incorrect.} is a
graphical windowing interface that comes with all popular Linux
distributions. X is available for many Unix-based operating systems; the
version of X that runs on Linux systems with x86-based CPUs is called
``XFree86.'' The current version of X is 11, Revision 6---or ``X11R6.''
All the command-line tools and most of the applications that you can run
in the console can run in X; also available are numerous applications
written specifically for X.
This chapter shows you how to get around in X: how to start it and stop
it, run programs within it, manipulate windows, and customize X to your
liking. See @cite{The Linux XFree86 HOWTO} for information on installing
X (@pxref{HOWTOs, , Reading System Documentation and Help Files}).
@menu
* Running X:: What X looks like, and how to run it.
* X Clients:: Running programs in X.
* Window Operations:: How to manipulate a window.
* Desktop:: Moving around the desktop.
* Xterm:: Running a shell in X.
* Configuring X:: Making X run the way you want it to.
@end menu
@node Running X, X Clients, X, X
@comment node-name, next, previous, up
@section Running X
@cindex running X
@cindex desktop
@cindex desktop environment
@cindex frames, window
@cindex pager
@cindex root window
@cindex title bar
@cindex window border
@cindex window manager
@pindex fvwm2
@pindex GNOME
@pindex KDE
@flushleft
@sf{WWW}: @url{http://www.afterstep.org/}
@sf{WWW}: @url{http://www.fvwm.org/}
@sf{WWW}: @url{http://www.windowmaker.org/}
@sf{WWW}: @url{http://www.gnome.org/}
@sf{WWW}: @url{http://www.kde.org/}
@end flushleft
@*
@noindent
When you start X, you should see a mouse pointer appear on the screen as
a large, black ``X.'' If your X is configured to start any tools or
applications, they should each start and appear in individual windows. A
typical X session looks like this:
@image{x-fvwm2, 4 in}
@c comma fix for texi2html
The @dfn{root window} is the background behind all of the other
windows. It is usually set to a color, but you can change it
(@pxref{Root Window, , Changing the Root Window Parameters}). Each
program or application in X runs in its own window. Each window has a
decorative border on all four sides, called the @dfn{window border};
L-shaped corners, called @dfn{frames}; a top window bar, called the
@dfn{title bar}, which displays the name of the window; and several
title bar buttons on the left and right sides of the title bar
(described in @ref{Window Operations, , Manipulating X Client Windows}).
The entire visible work area, including the root window and any other
windows, is called the @dfn{desktop}. The box in the lower right-hand
corner, called the @dfn{pager}, allows you to move about a large desktop
(@pxref{Desktop, , Moving around the Desktop}).
A @dfn{window manager} controls the way windows look and are
displayed---the window dressing, as it were---and can provide some
additional menu or program management capabilities. There are many
different window managers to choose from, with a variety of features and
capabilities. (@xref{Window Managers, , Choosing a Window Manager}, for
help in choosing a window manager that's right for you.)
Window managers typically allow you to customize the colors and borders
that are used to display a window, as well as the type and location of
buttons that appear on the window (@pxref{X Clients, , Running a Program
in X}). For example, in the image above, the clock image itself is the
@code{oclock} program; the blue outline around it is the window border,
as drawn by the @code{fvwm2} window manager. With the @code{afterstep}
window manager, the window border would look quite different:
@image{x-oclock-afterstep, }
@c comma fix for texi2html
There are many window managers you can choose from, all different;
instead of describing only one, or describing all of them only
superficially, this chapter shows the @emph{basics} of X, which are
common to all window managers. I try to make no assumptions as to which
window manager you are using; while the @code{fvwm} family of window
managers has long been a popular choice on most Linux-based systems,
today other window managers---including WindowMaker (the binary itself
is called @code{wmaker}), Enlightenment, AfterStep, and others---have all
gained in popularity.
And recently, @dfn{desktop environments} have become popular. These are
a collection of applications that run on top of the window manager (and
X), with the purpose of giving your X session a standardized ``look and
feel''; these suites normally come with a few basic tools such as clocks
and file managers. The two popular ones are GNOME and KDE, and while
they generate a lot of press these days because of their graphical
nature, both are changing very quickly and at the time of this writing
are not yet ready for widespread, general use (and they can cause your
system to crash).
If you have a recent Linux distribution and chose the default install,
chances are good that you have either GNOME or KDE installed, with
either the @code{fvwm2} or @code{wmaker} window manager assigned as the
default. (While you can have more than one window manager installed on
your system, you can only run one at a time.)
@menu
* Starting X:: How to start X.
* Stopping X:: How to stop X.
@end menu
@node Starting X, Stopping X, Running X, Running X
@comment node-name, next, previous, up
@subsection Starting X
@cindex starting X
@cindex X, starting
@pindex startx
@pindex xdm
@noindent
There are two ways to start X. Some systems run the X Display Manager,
@code{xdm}, when the system boots, at which point a graphical @code{xdm}
login screen appears; you can use this to log in directly to an X
session. On systems not running @code{xdm}, the virtual console reserved
for X will be blank until you start X by running the @code{startx}
command.
@itemize @bullet
@item
To start X from a virtual console, type:
@example
$ @kbd{startx @key{RET}}
@end example
@item
To run @code{startx} and redirect its output to a log file, type:
@example
$ @kbd{startx >$HOME/startx.log 2>&1 @key{RET}}
@end example
@end itemize
Both of these examples start X on the seventh virtual console,
regardless of which console you are at when you run the command---your
console switches to X automatically. You can always switch to another
console during your X session (@pxref{Console, , Console Basics}). The
second example writes any error messages or output of @code{startx} to a
file called @file{startx.log} in your home directory.
On some systems, X starts with 8-bit color depth by default. Use
@code{startx} with the special @samp{-bpp} option to specify the color
depth. Follow the option with a number indicating the color depth to
use, and precede the option with two hyphen characters (@samp{--}),
which tells @code{startx} to pass the options which follow it to the X
server itself.
@itemize @bullet
@item
To start X from a virtual console, and specify 16-bit color depth, type:
@example
$ @kbd{startx -- -bpp 16 @key{RET}}
@end example
@end itemize
@sp .25
@noindent
@strong{NOTE:} If your system runs @code{xdm}, you can always switch to
the seventh virtual console (or whichever console @code{xdm} is running
on), and then log in at the @code{xdm} login screen.
@node Stopping X, , Starting X, Running X
@comment node-name, next, previous, up
@subsection Stopping X
@cindex stopping X
@cindex X, stopping
@noindent
To end an X session, you normally choose an @code{exit X} option from a
menu in your window manager.
@itemize @bullet
@item
To end your X session if you are running the @code{fvwm2} window
manager, click the left mouse button in the root window to pull up the
start menu, and then choose @code{Really quit?} from the @code{Exit
Fvwm} submenu.
@item
To end your X session if you are running the @code{afterstep} window
manager, click the left mouse button in the root window to pull up the
start menu, and then choose @code{Really quit?} from the @code{Exit
Fvwm} submenu.
@end itemize
If you started your X session with @code{startx}, these commands will
return you to a shell prompt in the virtual console where the command
was typed. If, on the other hand, you started your X session by logging
in to @code{xdm} on the seventh virtual console, you will be logged out
of the X session and the @code{xdm} login screen will appear; you can
then switch to another virtual console or log in to X again.
To exit X immediately and terminate all X processes, press the
@key{CTRL}-@key{ALT}-@key{BKSP} combination (if your keyboard has two
@key{ALT} and @key{CTRL} keys, press the left ones). You'll lose any
unsaved application data, but this is useful when you cannot exit your X
session normally---in the case of a system freeze or other problem.
@itemize @bullet
@item
To exit X immediately, type:
@example
@kbd{@key{CTRL}-@key{ALT}-@key{BKSP}}
@end example
@end itemize
@node X Clients, Window Operations, Running X, X
@comment node-name, next, previous, up
@section Running a Program in X
@cindex programs, starting in X
@cindex clients, X
@cindex start menu
@cindex X client
@cindex X server
@pindex fvwm2
@pindex xclock
@pindex xterm
@noindent
Programs running in an X session are called X @dfn{clients}. (The X
Window System itself is called the X @dfn{server}). To run a program in
X, you start it as an X client---either by selecting it from a menu, or
by typing the command to run in an @code{xterm} shell window
(@pxref{Xterm, , Running a Shell in X}). Most window managers have a
``start menu'' of some kind; it's usually accessed by clicking the left
mouse button anywhere on the root window. To run an X client from the
start menu, click the left mouse button to select the client's name from
the submenus.
For example, to start a square-shaped, analog-face clock from the start
menu, click the left mouse button on the root window to make the menu
appear, and click the left mouse button through the application menus
and on @samp{Xclock (analog)}. This starts the @code{xclock} client,
specifying the option to display an analog face:
@image{x-xclock, }
@c comma fix for texi2html
You can also start a client by running it from a shell window---useful
for starting a client that isn't on the menu, or for when you want to
specify options or arguments. When you run an X client from a shell
window, it opens in its own window; run the client in the background to
free the shell prompt in the shell window (@pxref{Background Jobs, ,
Putting a Job in the Background}).
@itemize @bullet
@item
To run a digital clock from a shell window, type:
@example
$ @kbd{xclock -digital & @key{RET}}
@end example
@end itemize
This command runs @code{xclock} in the background from a shell
window; the @samp{digital} option specifies a digital
clock.
The following sections explain how to specify certain command-line
options common to most X clients---such as window layout, colors, and
fonts.
@menu
* Window Layout:: Specifying the size and location of a window.
* Window Colors:: Specifying the colors of a window.
* Window Fonts:: Specifying the fonts for a window.
* Window Attributes:: A list of window properties you can specify.
@end menu
@node Window Layout, Window Colors, X Clients, X Clients
@comment node-name, next, previous, up
@subsection Specifying Window Size and Location
@cindex specifying window size and location
@cindex window size and location, specifying
@cindex window geometry
@noindent
Specify a window's size and location by giving its @dfn{window geometry}
with the @samp{geometry} option. Four fields control the width and
height of the windows, and the window's distance (``offset'') from the
edge of the screen. It is specified in the form:
@example
-geometry WIDTHxHEIGHT+XOFF+YOFF
@end example
The values in these four fields are usually given in pixels, although
some applications measure @code{WIDTH} and @code{HEIGHT} in characters.
While you must give these values in order, you can omit either pair.
For example, to specify just the size of the window, give values for
@code{WIDTH} and @code{HEIGHT} only.
@itemize @bullet
@item
To start a small @code{xclock}, 48 pixels wide and 48 pixels high, type:
@example
$ @kbd{xclock -geometry 48x48 @key{RET}}
@end example
@item
To start a large @code{xclock}, 480 pixels wide and 500 pixels high,
type:
@example
$ @kbd{xclock -geometry 480x500 @key{RET}}
@end example
@item
To start an @code{xclock} with a width of 48 pixels and the default
height, type:
@example
$ @kbd{xclock -geometry 48 @key{RET}}
@end example
@item
To start an @code{xclock} with a height of 48 pixels and the default
width, type:
@example
$ @kbd{xclock -geometry x48 @key{RET}}
@end example
@end itemize
You can give positive or negative numbers for the @code{XOFF} and
@code{YOFF} fields. Positive @code{XOFF} values specify a position from
the left of the screen; negative values specify a position from the
right. If @code{YOFF} is positive, it specifies a position from the top
of the screen; if negative, it specifies a position from the bottom of
the screen. When giving these offsets, you must specify values for both
@code{XOFF} and @code{YOFF}.
To place the window in one of the four corners of the desktop, use
zeroes for the appropriate @code{XOFF} and @code{YOFF} values, as
follows:
@multitable @columnfractions .5 .5
@item @sc{XOFF and YOFF Values}
@tab @sc{Window Position}
@item @code{+0+0}
@tab Upper left corner.
@item @code{+0-0}
@tab Lower left corner.
@item @code{-0+0}
@tab Upper right corner.
@item @code{-0-0}
@tab Lower right corner.
@end multitable
@itemize @bullet
@item
To start a default size @code{xclock} in the lower left-hand corner,
type:
@example
$ @kbd{xclock -geometry +0-0 @key{RET}}
@end example
@end itemize
Or, to put it all together, you can specify the size and location of a
window with one geometry line that includes all four values.
@itemize @bullet
@item
To start an @code{xclock} with a width of 120 pixels, a height of 100
pixels, an x offset of 250 pixels from the right side of the screen, and
a y offset of 25 pixels from the top of the screen, type:
@example
$ @kbd{xclock -geometry 120x100-250+25 @key{RET}}
@end example
@end itemize
@node Window Colors, Window Fonts, Window Layout, X Clients
@comment node-name, next, previous, up
@subsection Specifying Window Colors
@cindex specifying window colors
@cindex window colors, specifying
@cindex colors, window
@pindex xcolors
@noindent
The window colors available in your X session depend on your display
hardware and the X server that is running. The @code{xcolors} tool will
show all colors available on your X server and the names used to specify
them. (Color names are not case sensitive.)
@itemize @bullet
@item
To list the available colors, type:
@example
$ @kbd{xcolors @key{RET}}
@end example
@end itemize
Press @kbd{@key{Q}} to exit @code{xcolors}.
To specify a color to use for the window background, window border, and
text or graphics in the window itself, give the color name as an
argument to the appropriate option: @samp{-bg} for background color,
@samp{-bd} for window border color, and @samp{-fg} for foreground color.
@itemize @bullet
@item
To start an @code{xclock} with a light blue window background, type:
@example
$ @kbd{xclock -bg lightblue @key{RET}}
@end example
@end itemize
You can specify any combination of these attributes.
@itemize @bullet
@item
To start an @code{xclock} with a sea green window background and a
turquoise window foreground, type:
@example
$ @kbd{xclock -bg seagreen -fg turquoise @key{RET}}
@end example
@end itemize
@node Window Fonts, Window Attributes, Window Colors, X Clients
@comment node-name, next, previous, up
@subsection Specifying Window Font
@cindex specifying window font
@cindex window font, specifying
@cindex font, window
@pindex xfontsel
@noindent
To get an X font name, use @code{xfontsel} (@pxref{X Fonts, , X Fonts}).
To specify a font for use in a window, use the @samp{-fn} option
followed by the X font name to use.
@itemize @bullet
@item
To start an @code{xclock} with a digital display, and specify that it
use a 17-point Helvetica font for text, type:
@example
$ @kbd{xclock -digital -fn -*-helvetica-*-r-*-*-17-*-*-*-*-*-*-* @key{RET}}
@end example
@end itemize
This command starts an @code{xclock} that looks like this:
@image{x-xclock-font, }
@c comma fix for texi2html
@sp .25
@noindent
@strong{NOTE:} If you specify the font for a shell window, you can
resize it after it's running, as described in @ref{Xterm Font, ,
Resizing the Xterm Font}.
@node Window Attributes, , Window Fonts, X Clients
@comment node-name, next, previous, up
@subsection Specifying Additional Window Attributes
@cindex specifying additional window attributes
@cindex window attributes, specifying additional
@noindent
X applications often have up to three special menus with options for
changing certain attributes. To see these menus, hold @key{CTRL} and
click one of the three mouse buttons.@footnote{If you have a mouse with
only two buttons, click both buttons simultaneously to emulate the
middle button.} The following table lists and describes various window
attributes common to most X-aware applications.
@multitable @columnfractions .3 .6
@item @sc{Window Options}
@tab @sc{Description}
@item @code{-bd @var{color} @* -bordercolor @var{color}}
@tab @* Use @var{color} for the window border color.
@item -bg @var{color} @* -background @var{color}
@tab @* Use @var{color} for the window background color.
@item -bw @var{number} @* -borderwidth @var{number}
@tab @* Specify the window border width in pixels.
@item -fg @var{color} @* -foreground @var{color}
@tab @* Use @var{color} for the window foreground text or graphics.
@item -fn @var{font} @* -font @var{font}
@tab @* Use @var{font} for the font to use.
@item -geometry @var{geometry}
@tab Specify window geometry.
@item -iconic
@tab Immediately iconify the program (@pxref{Minimizing Windows, ,
@w{Minimizing} a Window}).
@item -title @var{string}
@tab Use @var{string} for the window title.
@end multitable
@node Window Operations, Desktop, X Clients, X
@comment node-name, next, previous, up
@section Manipulating X Client Windows
@cindex manipulating X client windows
@cindex windows, manipulating
@cindex X clients, manipulating windows of
@cindex window border
@cindex active client
@pindex xclock
@noindent
Only one X client can accept keyboard and mouse input at a time, and
that client is called the @dfn{active client}. To make a client active,
move the mouse over the client's window. When a client is the active
client, it is said to be ``in focus.'' Depending on the window manager,
the shape of the mouse pointer may change, or the window border and
title bar of the active client may be different (a common default is
steel blue for the active client color and gray for all other windows).
Each window has its own set of controls to manipulate that window.
Here's how to perform basic window operations with the mouse.
@menu
* Moving Windows:: Moving a window.
* Resizing Windows:: Resizing a window.
* Destroying Windows:: When you don't want a window anymore.
* Minimizing Windows:: Turning a window into an icon.
* Maximizing Windows:: Restoring a window from an icon.
@end menu
@node Moving Windows, Resizing Windows, Window Operations, Window Operations
@comment node-name, next, previous, up
@subsection Moving a Window
@cindex moving a window
@cindex windows, moving
@cindex window outline
@cindex title bar
@noindent
To move a window, click and hold the left mouse button on the window's
title bar, then drag its @dfn{window outline} to a new position. When
the outline is in place, release the left mouse button, and the window
will move to the position held by the window outline.
@node Resizing Windows, Destroying Windows, Moving Windows, Window Operations
@comment node-name, next, previous, up
@subsection Resizing a Window
@cindex resizing a window
@cindex windows, resizing
@cindex frames, window
@noindent
To resize a window, click and hold the left mouse button on any one of
the window's four frames, and move the mouse to shrink or grow the
window outline. Release the left mouse button to resize the window to
the size of the window outline.
@node Destroying Windows, Minimizing Windows, Resizing Windows, Window Operations
@comment node-name, next, previous, up
@subsection Destroying a Window
@cindex destroying a window
@cindex windows, destroying
@cindex title bar
@noindent
To destroy a window and stop the program it displays, click the left
mouse button on the @samp{X} button in the upper right-hand corner of
the title bar. This is useful for when the program running in the
window has stopped responding. (Of course, if a program in a window has
an option to stop it normally, you can always use it to stop the program
and close its window.)
@node Minimizing Windows, Maximizing Windows, Destroying Windows, Window Operations
@comment node-name, next, previous, up
@subsection Minimizing a Window
@cindex minimizing a window
@cindex windows, minimizing
@cindex windows, iconifying
@noindent
To @dfn{minimize} a window, so that it disappears and an icon
representing the running program is placed on the desktop, click the
left mouse button on the @samp{_} button in the upper right-hand corner
of the title bar. This is also called @dfn{iconifying} a window.
@node Maximizing Windows, , Minimizing Windows, Window Operations
@comment node-name, next, previous, up
@subsection Maximizing a Window
@cindex maximizing a window
@cindex windows, maximizing
@cindex windows, deiconifying
@noindent
To @dfn{maximize} an icon to a window (or ``deiconify'' it),
double-click the left mouse button on the icon name, directly beneath
the icon itself. The icon will disappear and the window will return to
its prior position.
@node Desktop, Xterm, Window Operations, X
@comment node-name, next, previous, up
@section Moving around the Desktop
@cindex moving around the desktop
@cindex desktop, moving around the
@cindex virtual desktop
@cindex sticky windows
@cindex windows, sticky
@cindex pager
@noindent
Many window managers (including @code{afterstep} and @code{fvwm2}) allow
you to use a @dfn{virtual desktop}, which lets you use more screen space
than your monitor can display at one time. A virtual desktop can be
larger than the display, in which case you can scroll though it with the
mouse. The view which fills the display is called the
@dfn{viewport}. When you move the mouse off the screen in a direction
where the current (virtual) desktop extends, the view scrolls in that
direction. Virtual desktops are useful for running many clients full
screen at once, each in its own separate desktop.
Some configurations disallow scrolling between desktops; in that case,
switch between them with a @dfn{pager}, which shows a miniature view of
your virtual desktop, and allows you to switch between desktops. It is a
@dfn{sticky window} (it ``sticks to the glass'' above all other
windows), and is always in the lower right-hand corner of your screen,
even when you scroll across a virtual desktop. Both your current desktop
and active X client are highlighted in the pager.
The default @code{fvwm2} virtual desktop size is nine desktops in a 3x3
grid:
@image{x-fvwm2-desktop,}
@c comma fix for texi2html
In the preceding illustration, the current desktop is the second one in
the top row. The first desktop contains two X client windows---a small
one and a large one---but there are no windows in any other desktop
(including the current one).
To switch to another desktop, click the left mouse button on its
corresponding view in the pager, or use a keyboard shortcut. In
@code{fvwm2}, the default keys for switching between desktops are
@key{ALT} in conjunction with the arrow keys; in @code{afterstep}, use
the @key{CTRL} key in place of @key{ALT}.
@itemize @bullet
@item
To switch to the desktop to the left of the current one while running
@code{fvw2}, type @kbd{@key{ALT}-@key{{@math{@leftarrow}}}}.
@ifinfo
[GNU INFO BUG: any <> in the preceding line should be the <- and/or -> arrow keys.]
@end ifinfo
@item
To switch to the desktop directly to the left of the current one while
running @code{afterstep}, type
@kbd{@key{CTRL}-@key{{@math{@leftarrow}}}}.
@ifinfo
[GNU INFO BUG: any <> in the preceding line should be the <- and/or -> arrow keys.]
@end ifinfo
@end itemize
@node Xterm, Configuring X, Desktop, X
@comment node-name, next, previous, up
@section Running a Shell in X
@cindex running a shell in X
@cindex console, emulating in X
@cindex shell, running in X
@pindex xterm
@pindex wterm
@pindex rxvt
@noindent
Use @code{xterm} to run a shell in a window. You can run commands in an
@code{xterm} window just as you would in a virtual console; a shell in
an @code{xterm} acts the same as a shell in a virtual console
(@pxref{Shell, , The Shell}).
Unlike a shell in a console, you can cut and paste text from an
@code{xterm} to another X client (@pxref{Selecting Text, , Selecting
Text}).
To scroll through text that has scrolled past the top of the screen,
type @kbd{@key{Shift}-@key{PgUp}}. The number of lines you can scroll
back to depends on the value of the scrollback buffer, specified with
the @samp{-sl} option; its default value is 64.
There are many options for controlling @code{xterm}'s emulation
characteristics; consult the @code{xterm} @code{man} page for a complete
listing (@pxref{Man, , Reading a Page from the System Manual}).
@sp .25
@noindent
@strong{NOTE:} @code{xterm} is probably the most popular terminal
emulator X client, but it is not the only one; others to choose from
include @code{wterm} and @code{rxvt}, all with their own special
features---try them all to find one you like.
@node Configuring X, , Xterm, X
@comment node-name, next, previous, up
@section Configuring X
@cindex configuring X
@cindex X, configuring
@noindent
There are some aspects of X that people usually want to configure right
away. This section discusses some of the most popular, including
changing the video mode, automatically running clients at startup, and
choosing a window manager. You'll find more information on this subject
in both @cite{The X Window User HOWTO} and @cite{The Configuration
HOWTO} (for how to read them, see @ref{HOWTOs, , Reading System
Documentation and Help Files}).
@menu
* Video Modes:: Changing video modes and resolutions.
* Xsession:: Running certain clients automatically.
* Root Window:: Changing the root window parameters.
* Window Managers:: The choice of window manager is yours!
@end menu
@node Video Modes, Xsession, Configuring X, Configuring X
@comment node-name, next, previous, up
@subsection Switching between Video Modes
@cindex switching between video modes
@cindex video modes, switching between
@noindent
A @dfn{video mode} is a display resolution, given in pixels, such as
640x480. An X server can switch between the video modes allowed by your
hardware and set up by the administrator; it is not uncommon for a
machine running X to offer several video modes, so that 640x480,
800x600, and 1024x768 display resolutions are possible.
To switch to another video mode, use the @key{+} and @key{-}
keys on the numeric keypad with the left @key{CTRL} and @key{ALT} keys.
The @key{+} key switches to the next mode with a lower resolution, and
the @key{-} key switches to the next mode with a higher resolution.
@itemize @bullet
@item
To switch to the next-lowest video mode, type:
@example
@key{CTRL}-@key{ALT}-@key{+}
@end example
@item
To switch to the next-highest video mode, type:
@example
@key{CTRL}-@key{ALT}-@key{-}
@end example
@end itemize
Type either of the above key combinations repeatedly to cycle through
all available modes.
@sp .25
@noindent
@strong{NOTE:} For more information on video modes, see @cite{The
XFree86 Video Timings HOWTO} (@pxref{HOWTOs, , Reading System
Documentation and Help Files}).
@node Xsession, Root Window, Video Modes, Configuring X
@comment node-name, next, previous, up
@subsection Running X Clients Automatically
@cindex running x clients automatically
@cindex X clients, running automatically
@cindex .xsession
@pindex fvwm2
@pindex oclock
@noindent
The @file{.xsession} file, a hidden file in your home directory,
specifies the clients that are automatically run when your X session
first starts (``hidden'' files are explained in @ref{Files and
Directories, , Files and Directories}). It is just a shell script,
usually containing a list of clients to run. You can edit your
@file{.xsession} file in a text editor, and if this file doesn't exist,
you can create it.
Clients start in the order in which they are listed, and the last line
should specify the window manager to use. The following example
@file{.xsession} file starts an @code{xterm} with a black background and
white text, puts an @file{oclock} (a round clock) window in the upper
left-hand corner, starts the Emacs text editor, and then starts the
@code{fvwm2} window manager:
@example
@group
#! /bin/sh
#
# A sample .xsession file.
xterm -bg black -fg white &
oclock -geometry +0+0 &
emacs &
exec /usr/bin/X11/fvwm2
@end group
@end example
All clients start as background jobs, with the exception of the window
manager on the last line, because when this file runs, the X session is
running in the foreground (@pxref{Managing Jobs, , Managing Jobs}).
Always put an ampersand (@samp{&}) character at the end of any command
line you put in your @file{.xsession} file, except for the line giving
the window manager on the last line.
@node Root Window, Window Managers, Xsession, Configuring X
@comment node-name, next, previous, up
@subsection Changing the Root Window Parameters
@cindex changing the root window parameters
@cindex root window parameters, changing the
@cindex bitmaps
@pindex xsetroot
@noindent
By default, the root window background is painted gray with a weaved
pattern. To draw these patterns, X tiles the root window with a
@dfn{bitmap}, which is a black-and-white image stored in a special file
format. X comes with some bitmaps installed in the
@file{/usr/X11R6/include/bitmaps/} directory; the default bitmap file is
@file{root_weave} (you can make your own patterns with the @code{bitmap}
tool; see @ref{Image Editors, , Interactive Image Editors and Tools}).
Use @code{xsetroot} to change the color and bitmap pattern in the root
window.
To change the color, use the @samp{-solid} option, and give the name of
the color to use as an argument. (Use @code{xcolors} to get a list of
possible color names; @pxref{Window Colors, , Specifying Window
Colors}.)
@itemize @bullet
@item
To change the root window color to blue violet, type:
@example
$ @kbd{xsetroot -solid blueviolet @key{RET}}
@end example
@end itemize
To change the root window pattern, use the @samp{-bitmap} option, and
give the name of the bitmap file to use.
@itemize @bullet
@item
To tile the root window with a star pattern, type:
@smallexample
$ @kbd{xsetroot -bitmap /usr/X11R6/include/bitmaps/star @key{RET}}
@end smallexample
@end itemize
When specifying a pattern, use the @samp{-fg} and @samp{-bg} options to
specify the foreground and background colors.
@itemize @bullet
@item
To tile the root window with a light slate gray star pattern on a black
background, type (all on one line):
@example
$ @kbd{xsetroot -fg slategray2 -bg black -bitmap
/usr/X11R6/include/bitmaps/star @key{RET}}
@end example
@end itemize
Use @code{xsetroot} with the special @samp{-gray} option to change the
root window to a shade of gray designed to be easy on the eyes, with no
pattern.
@itemize @bullet
@item
To make the root window a gray color with no pattern, type:
@example
$ @kbd{xsetroot -gray @key{RET}}
@end example
@end itemize
@sp .25
@noindent
@strong{NOTE:} You can also put an image in the window (although this
consumes memory that could be spared for a memory-hogging Web browser
instead; but see @ref{Root Window Images, , Putting an Image in the Root
Window}, for how to do it).
@node Window Managers, , Root Window, Configuring X
@comment node-name, next, previous, up
@subsection Choosing a Window Manager
@cindex choosing a window manager
@cindex window managers, choosing
@cindex LaStrange, Tom
@pindex 9wm
@pindex afterstep
@pindex enlightenment
@pindex twm
@pindex wm2
@pindex fvwm2
@pindex fvwm95
@noindent
Yes, there are @emph{many} window managers to choose from. Some people
like the flashiness of Enlightenment, running with KDE or GNOME, while
others prefer the spartan @code{wm2}---the choice is yours.
The following table describes some of the more popular window managers
currently available.
@multitable @columnfractions .30 .70
@item @sc{Window Manager}
@tab @sc{Description}
@item @code{9wm}
@tab @code{9wm} is a simple window manager inspired by AT&T's Plan 9 window
manager---it does not use title bars or icons. It should appeal to those
who like the @code{wily} text editor (@pxref{Text Editors, , Choosing
the Perfect Text Editor}).
@noindent
{@sf{Debian}}: @file{9wm}
@noindent
{@sf{WWW}}: @url{ftp://ftp.cs.su.oz.au/dhog/9wm/}
@item @code{afterstep}
@tab AfterStep is inspired by the look and feel of the NeXTSTEP interface.
@noindent
{@sf{Debian}}: @file{afterstep}
@noindent
{@sf{WWW}}: @url{http://www.afterstep.org/}
@item @code{enlightenment}
@tab Enlightenment is a graphics-intensive window manager that uses desktop
``themes'' for decorating the various controls of the X session.
@noindent
{@sf{Debian}}: @file{enlightenment}
@noindent
{@sf{WWW}}: @url{http://www.enlightenment.org/}
@item @code{fvwm95}
@tab @code{fvwm95} makes X look like a certain proprietary, corporate OS from
circa 1995.
@noindent
{@sf{Debian}}: @file{fvwm95}
@noindent
{@sf{WWW}}: @url{http://www.foxproject.org/xclass/fvwm95.html}
@item @code{twm}
@tab The Tab Window Manager is an older, simple window manager that is
available on almost every system. (It's also sometimes called Tom's
Window Manager, named after its primary author, Tom LaStrange.)
@noindent
{@sf{Debian}}: @file{twm}
@item @code{wm2}
@tab @code{wm2} is a minimalist, configuration-free window manager.
@noindent
{@sf{Debian}}: @file{wm2}
@noindent
{@sf{WWW}}: @url{http://www.all-day-breakfast.com/wm2/}
@end multitable
|