Debian GNU/Linux: Guide to Installation and Usage - John Goerzen and Ossama Othman (top fiction books of all time .txt) 📗
- Author: John Goerzen and Ossama Othman
- Performer: -
Book online «Debian GNU/Linux: Guide to Installation and Usage - John Goerzen and Ossama Othman (top fiction books of all time .txt) 📗». Author John Goerzen and Ossama Othman
Text files can contain shell scripts, documentation, copyright notices, or any other human-readable text.
Incidentally, this illustrates the difference between source code and binary executables. binls is a binary executable you can download from Debian, but you can also download a text file that tells the computer how to create binls. This text file is the source code. Comparing binls to etcprofile illustrates how important source code is if someone wants to understand and modify a piece of software. Free software provides you or your consultants with this all-important source code.
Text Editors A text editor is a program used to create and change the contents of text files. Most operating systems have a text editor: DOS has edit, Windows has Notepad, MacOS has SimpleText.
Debian provides a large variety of text editors. vi and Emacs are the classic two, which are probably both the most powerful and the most widely used. Both vi and Emacs are quite complex and require some practice, but they can make editing text extremely efficient. Emacs runs both in a terminal and under the X Window system; vi normally runs in a terminal but the vim variant has a -g option that allows it to work with X. text editors
Simpler editors include nedit, ae, jed, and xcoral. nedit and xcoral provide easy-to-use X Window system graphical interfaces. There are also several vi variants. Additionally, you can find and a GNU Emacs variant called XEmacs.
This book does not cover the use of any particular editor in detail, though we will briefly introduce ae since it is small, fast, and can be found even on the Debian rescue disks, so it pays to know a bit about it for usage in a pinch. When you need to do more serious editing, check out vim or GNU Emacs. Emacs provides an excellent interactive tutorial of its own; to read it, load Emacs with the emacs command and type F1 t. Emacs is an excellent choice for new users interested in a general-purpose or programming editor.
Using ae
You can start ae by giving it the name of a file to edit, like so: $ ae filename.txt
This will bring up an editor screen. The top part of this screen provides some quick help; the bottom shows the file you’re editing. Moving around in this editor is simple; just use the arrow keys. You can save the file by pressing C-x C-s and then exit the editor by pressing C-x C-c. Once you feel comfortable with the editor, you can press C-x C-h to turn off the help. That’s it! Knowing this will let you do basic editing. For programming or more detailed editing work, you’ll want to investigate other editors as discussed earlier.
The X Window System This chapter describes the X Window system graphical user interface. It assumes that you have already successfully configured X as described in the Installation Manual (again, the install manual is not yet written; for now you will need to use the XFree86 HOWTO, the contents of usrdoc/X11, and this chapter). Once you install X, you can enter the X environment by typing startx or via xdm, depending on your choice during configuration.
Introduction to XA GUI (Graphical User Interface) is part and parcel of the Windows and Mac operating systems. It’s basically impossible to write an application for those systems that does not use the GUI, and the systems can’t be used effectively from the command line. GNU/Linux is more modular, that is, it’s made up of many small, independent components that can be used or not according to one’s needs and preferences. One of these components is the X
Window system, or simply X.
This component is also sometimes called X11. Please note that “X
Windows” is not correct.
X itself is a means for programs to talk to your mouse and video card without knowing what kind of mouse and video card you have. That is, it’s an abstraction of the graphics hardware. User applications talk to X in X’s language; X then translates into the language of your particular hardware. This means that programs only have to be written once, and they work on everyone’s computer.
In X jargon, the program that speaks to the hardware is known as an X
server. User applications that ask the X server to show windows or graphics on the screen are called X clients. The X server includes a video driver, so you must have an X server that matches your video card.
The X server doesn’t provide any of the features one might expect from a GUI, such as resizing and rearranging windows. A special X client, called a window manager, draws borders and title bars for windows, resizes and arranges windows, and provides facilities for starting other X clients from a menu. Specific window managers may have additional features.
Window managers available on a Debian system include fvwm, fvwm2, icewm, afterstep, olvwm, wmaker, twm, and enlightenment. You’ll probably want to try them all and pick your favorite.
Neither the X server nor the window manager provide a file manager; that is, there aren’t any windows containing icons for your files and directories. You can launch a file manager as a separate application, and there are many of them available. The GNOME desktop project is developing an icon-based file manager and other GUI facilities. See the GNOME
homepage for the latest news on this.
A final feature of X is its network transparency, meaning that X clients don’t care if they’re talking to an X server on the same machine or an X
server somewhere on the network. In practical terms, this means you can run a program on a more powerful remote machine but display it on your desktop computer.
Starting the X Environment There are two ways to start X. The first is to start X manually when you feel like using it. To do so, log in to one of the text consoles and type startx. This will start X and switch you to its virtual console.
The second (and recommended) way to use X is with xdm or X Display Manager. Basically, xdm gives you a nice graphical login prompt on the X
virtual console (probably VC 7), and you log in there.
By default, either method will also start an xterm, which is a small window containing a shell prompt. At the shell prompt, you can type any commands just as you would on a text VC. So you can follow all the examples in this book using xterm; the only difference between an xterm and the text console is that you don’t have to log on to the xterm because you already logged on to X.
There are also a lot of things you can do only in X, which are covered in this chapter.
One note: The default xterm window has a smallish font. If you have a small monitor or very high resolution or bad eyesight, you may want to fix this. Follow these steps:
1. Move the mouse pointer into the center of the xterm window.
2. Hold down the Control key and the right mouse button simultaneously.
This will give you a font menu.
3. Point to the font you want and release the mouse button.
Basic X Operations There are certain commonly used operations in X that you should familiarize yourself with. This section describes some of the basic operations that you may find useful.
The Mouse
The mouse in X works pretty much the same as the mouse on other systems, except that it has three buttons. If your mouse has only two, you can simulate the middle button by clicking both buttons simultaneously. This is kind of tricky and annoying, so investing in a $15 three-button mouse probably isn’t a bad idea. These are available from most computer retailers.
The buttons are numbered from left to right assuming you have a right-handed mouse. So button one is on the left, two is in the middle, and three is on the right. You may see either the numbers or the locations in documentation.
X has a simple builtin copy-and-paste facility. To select text to copy, you click and drag with the left mouse button. This should select the text to copy, assuming the application you’re using has copy-and-paste support.
To paste the text, you click the middle mouse button in a different X
application. For example, if you receive an e-mail containing an URL, you can select the URL with the left button and then click in your web browser’s “Location” field with the middle button to paste it in.
X Clients
Programs that communicate with the X server are called X clients. Most of these programs will ask the X server to display windows on the screen.
You start an X client the same way you start any other Debian program.
Simply type the name of the client on the command line. Try typing xterm into an existing xterm window, and a new xterm client will appear on the screen.
You may notice that the original xterm is now useless, because your shell is waiting for the second xterm to finish. To avoid this problem, you can run the X client in the backgroundby adding a & after the command name like this: xterm &. If you forget, you can place a running process in the background. First suspend the process with CTRL-z, and then place it in the background with the bg command.
If you use a program often, your window manager will generally provide a way to put that program on a convenient graphical menu.
Troubleshooting
Sometimes when you launch an X client from a graphical menu, you won’t be able to see any error messages if it fails. You can find any error messages in the file ~/.xsession-errors.
Leaving the X Environment
To leave X, you need to use a menu. Unfortunately for beginners, this is different for every window manager, and for most window managers, it can be configured in many ways. If there’s an obvious menu, look for an entry like “Exit” or “Close Window Manager.” If you don’t see a menu, try clicking each of the mouse buttons on the background of the screen. If all else fails, you can forcibly kill the X server by pressing CTRL-ALT-Backspace. Forcibly killing the server destroys any unsaved data in open applications.
Customizing Your X Startup When you start X, Debian runs some shell scripts that start your window manager and other X clients. By default, a window manager, an xconsole, and an xterm are started for you.
To customize your X startup, the file etcX11/config must contain the line allow-user-xsession. If it does not, log in as root and add the line now. Then log back in as yourself and continue the tutorial.
You can see how Debian’s X startup works in the file etcX11/ Xsession.
Note that you can change the behavior of etcX11/Xsession by modifying the file etcX11/config, which specifies a few system-wide preferences.
To run the clients of your choice when X starts, you create an executable shell script called .xsession in your home directory.
$ touch ~/.xsession
This creates the file.
$ chmod u+x ~/.xsession
This makes the file executable.
Once .xsession is created, you need to edit it to do something useful with your favorite text editor. You can do anything you want to in this script.
However, when the script’s process terminates, X also terminates.
In practical terms, this means that you often end the script with a call to exec. Whatever program you exec will replace
Comments (0)