Window Placement


Now that you have started your Unix system and your environment has been initialized, you may want to specify specific window placement. You saw this in our original sample .xinitrc script:

 #!/bin/sh xrdb -load $HOME/.X11defaults xscreensaver -timeout 10 & xterm -geometry 80x30+10+10 & 

You can set your window placement with the -geometry (-g) switch. Using -geometry is not difficult, as you can see from our example. Don't let the numbers scare youthey are nothing but settings. Once you know the command, the switch, and the settings, you can take a program like xterm and specify the size and placement of any window. The geometry of a window consists of its dimensions and its position on the screen. In our example, the geometry is specified by the numbers 80x30+10+10. These numbers can be easily broken down as follows:

  • 80x30 is the window's dimensions. These numbers "size" the window.

  • The position of the window is set by +10+10. This is not a math problem looking for a sum; it's the actual screen coordinates where the window will be placed.

This means that an xterm window with the dimensions of 80x30 will be launched at the screen coordinates of +10+10.

The .xinitrc script specifies this change from the default window size and location that are built into the program. If you do not like the placement of your window, go to your home directory, edit the .xinitrc file, and change the geometry to your liking. Once you boot up again (or startx), you will see your changes.

The xwininfo command can also be used to view sample geometry if you prefer to navigate the X Window System GUI. In Figure 3.1, you can see an example of this.

Figure 3.1. Using the xwininfo command.


Restart To start the X Window System using your customized .xinitrc script, type xinit at your workstation prompt. If you receive an error when attempting this command, you may need to remove a lock file in your temp (tmp) directory. You can use the remove directory command (rm), which, when used with the appropriate switch and the appropriate path, will remove any problem files. Use rm -f /tmp/*, which will attempt to remove everything from your temp directory, or specify the actual file, such as by typing rm -f /tmp/.X0-lock.


We have taken a pretty deep look at the X Window System and how to customize it. Now, after learning how to log in, get help, and tweak your environment, you should start to gain comfort in working with Unix. In addition, although we have only worked through Part I, "Learning the Unix Environment: Baby Steps," of this text, you should feel comfortable running a few commands, and you should understand basic navigation if you are operating within a GUI. Let's move on to more customization and tips to help you work within Unix even more comfortably.



    SAMS Teach Yourself Unix in 10 Minutes
    Sams Teach Yourself Unix in 10 Minutes (2nd Edition)
    ISBN: 0672327643
    EAN: 2147483647
    Year: 2005
    Pages: 170

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net