Tuesday, November 25, 2008

100 X Window System

X Window System is a GUI made for running on a network, and especially (although by no means exclusively) on Linux and Unix machines. Learning X teaches one a lot about what other GUIs are doing under the hood. We'll take a not-too-detailed look at it today.

  1. First we need to discuss X as a client/server system. We will be running programs as clients of an X server on wocsc.nvcc.edu: it will send commands to our machines, which will draw according to the commands. See the end of the Wikipedia article's section on the X design for a sketch of this scenario. Please scroll through the entire article.

  2. We also need a server on our own machines, to send and receive X commands with both the wocsc server and us. We will use Xming. Please scroll through the author's description of it.

  3. The only piece of Xming that we absolutely have to have is the public domain release of Xming. Get the fonts later, if you want.

  4. The default install options for Xming will work fine. It would be a good idea to allow the program to create a desktop icon for Xlaunch. You don't need one for Xming itself. Do not launch Xming at the end of the installation.

  5. Use the Xlaunch icon that should be on your desktop. In the Display settings window, choose Fullscreen for the full-bore X experience.

  6. In the Session type window, choose Start a program.

  7. In Start program, accept xterm and choose Run remote using PuTTY. Not to worry, PuTTY was installed along with X. You will connect to computer wocsc.nvcc.edu, natch, and you know your username, I trust.

  8. Additional parameters: none.

  9. Give your configuration a name, such as wocscFS, so that it's convenient to use it again. Take care to put it on your desktop.

  10. Click yes on the Security alert.

  11. Et voila, your first X session with program xterm running. You're connected to wocsc.

  12. Welcome to 1984! This distinctive look screams geek.

  13. You're at wocsc. Notice the behavior of the cursor. Check your mail, do whoami, pwd, ps, ps -e, etc.

  14. Can you move the xterm window? Ha-ha! You have no window manager! Ha-ha! Enter twm & in the xterm window to start one. You get a lot of font messages, then an old-fashioned window manager. Look up twm in Safari if you would like to learn how to set all of its settings.

  15. Enter xeyes &. Enter oclock &. Enter xclock &. Mmmm, what fun!

  16. Close Xming with an exit in the xterm window, or nuke it in the system tray. Go back to the Xming site and get the fonts, install them, then repeat the above steps. In your xterm window, enter emacs &. This is one of the word processors over which religious wars are fought.

  17. Close your X session altogether, then start a new one, and this time in the xterm window, enter metacity. This is a very lightweight window manager. For links to others, visit this page. Geek heaven! These are not available on our server, but you can have them at home.

  18. Back in X, enter nautilus & in the xterm window. Things are looking good...

  19. Actually, Metacity is so light that it is not very capable, compared to other GUIs. That's one of the good things about it, for those who love it. Here's the readme.

  20. There are heavyweight GUIs, too. Including whole operating systems. You can emulate *nix on a Windows box with Cygwin. This is a Windows application itself, so it's not necessarily fast, but it's very safe and a very good workalike.

    And the latest cool, very cool install for Linux alongside Windows that I have seen is Wubi.
For a big finish, download and run a Java program with a GUI, one of your own or one from out textbook. You win!





Metacity readme
http://svn.gnome.org/viewvc/metacity/trunk/README?view=markup

No comments: