Introduction
This is a guide to customizing your desktop so that it looks "cool", or at least is easier on your eyes than the default settings. It's considerably more difficult to do than it is in Windows or on a Mac, but you have a *lot* more control over the fine details of how everything works. You should probably read through the entire file first to get some sort of idea of what you *can* do. Also, make sure that you're comfortable opening, editing, and saving files in XEmacs.
Also, most of the changes you make won't take effect until you log out and back in to your computer, or restart fvwm by choosing the "restart fvwm" option from the root menus you get when you click on the desktop with the mouse. Changes to your .login files take effect the next time you login.
Options
Most commands and options take a particular sort of data. Here's the list, and how to figure out what to put there:
< color >A color. Pretty much anything in a small Crayola set will work, like "magenta" or "orange" or "blue". If you want to get artsy, run xcolorsel in a shell and it will pop up a window with a *lot* of colors listed in it (and what they look like). Most of these can also take numbers after them to make them lighter or darker, like "blue3" or "fuschia4" or "SteelGrey2". Type the name of one of these where it says to use a < color >. You can also specify colors as #RRGGBB, like you do for HTML (if you have no idea what that means, just use the names).
< font >
The name of a font. I have no good way to get a list of all available fonts,
so it's best to leave these options alone. Fonts in Solaris have really
ridiculous names, like
-adobe-helvetica-bold-r-*-*-*-140-*-*-*-*-iso8859-1 or
-linotype-helvetica-medium-r-narrow-sans-14-*.
A number, like "2" or "4" or "12459287". Usually has to be positive, although 0 is almost always the defau< value.
< true|false >Type either true or false. ( '|' is used to stand for "or" sometimes in CS and math ).
< name > or < string >A name, like "Matt's Cool Program" or "Bob". Sometimes needs quotes around it, and definitely if it has spaces in it. Experiment.
< filename > or < file > or < image >A filename. This should be an absolute path, like ~/images/ReallyCoolBackground.jpg.
< geometry >A geometry parameter, specifying the size and location of a window. These are kinda tricky, but here's the syntax:
< width > x < height > [+|-] < horizontal offset > [+|-] < vertical offset >
These are all < number > s, in pixels, except for when you're setting xterm and xemacs, which are in characters (This almost makes sense, but not really.) If an offset is positive, it's that far from the left/top of the screen. If negative, it's that far from the right/bottom of the screen. This sounds horribly complicated, but it's not so bad. If you look at the things already in there and where they show up on your screen, it should make sense.
For instance, I have this line:
dclock*geometry: 115x75-0+0
The clock shows up as a rectangular window, 115 by 75 pixels, in the upper right corner of the screen (-0 means 0 pixels from the *right* edge, and +0 means 0 pixels from the *top* edge).
Almost every program that creates a window will also take a -geometry paramater on the command line, like this:
xemacs -geometry 100x40+50+20
Just as a note, your screen is about 1200x1000 pixels, although you can make windows as big as you want. Whatever doesn't fit on the screen will just spill over onto the other virtual desktops.
Backgrounds
Gee, everyone's got cool backgrounds, don't they? Bet you want one, too. The place to do it is in your .xinitrc file. You should have a line in there that looks like this:
xsetroot < blah blah blah >
This sets the background *color*. use 'man xsetroot' to get all the different settings, and you can use the same colors as for programs (from xcolorsel). If you want an image, add this line right after that one:
xv -root -quit [-max] < image > &
This runs xview (an image viewing program), tells it to display the image in the background, and to not keep running. If you use -max, it scales the image to full screen; otherwise, it shows up in the middle with the background color at the edges. The image should be a .jpg file (.gif probably works too); it'll figure out the size automatically. Keep in mind that you don't have a lot of space for big 24-bit color images in your folders.
Colors
To change the colors of windows and text in programs, you need to edit the .fvwm2rc file (this might be .fvwmrc if you have an older account from last year). You should see some entries that look like this:
TitleStyle Inactive (HGradient 100 2 navy 50 grey78 50 navy -- Raised) ActiveUp (HGradient 100 2 navy 50 black 50 navy -- Raised) ActiveDown (HGradient 50 2 darkslateblue 50 azure 50 darkslateblue -- Raised)
You can change the HGradient values into (Solid < color
>) if you want solid-colored title bars. You can also edit the
values in the gradients (or add more colors) to change how they look.
All this and *much* more is explained in the man pages for fvwm2, which can be accessed by typing man fvwm2 in a shell.
Window System Behavior
In ~/.fvwm2rc are about a million options you can configure about a) how windows and menus look and act, b) how different programs display, and c) what's on those menus you get when you click on the background.
For .fvwm2rc:
EdgeResistance and EdgeScroll change what happens
when you move the mouse to the edge of the screen (whether or not it moves you
to another virtual desktop).
ClickTime changes how fast you have to click (and, by extension,
double-click) for it to be recognized.
The "Style" settings that you'll most likely use are:
-
BorderWidth < number >, HandleWidth < number >-- unsurprisingly, these adjust the border and title bar size. -
NoTitle-- window has no title bar / menu at the top, but still has edges unless you also specify "NoHandles". -
Sticky-- window shows up on all virtual desktops. Good for dclock and the mail reminder thingy, and maybe a terminal window. -
StaysOnTop-- it stays on top unless you specifically lower the window. -
SloppyFocus-- puts focus in a window whenever your mouse is over it, but doesn't unfocus the window if you move the mouse on the desktop. I personally hate this, and the default, which is "you can only type in a window that your mouse is in front of". -
ClickToFocus-- you have to actually click on the window to make it focus (so you can type in it). Works like Windows and Mac. -
NoHandles-- there's no bars around the edge of the window. If you use this with "NoTitle", the window just sort of sits there (and has to be moved with a Meta-drag if you need to move it).
There are *lots* and *lots* of options for the popup menus, key bindings, and other things you probably don't want to mess with. But you can. If you want to change them, you'll have to look at what's in the file and figure out how it works. And using man fvwm2 is also probably a good idea.
Terminals
NOTE: I find terminals (or any windows) that don't have a solid background really annoying. They give me eyestrain, especially colorful, transparent ones. It certainly *looks* cool, but it's a pain to work with.
That said, if you actually want a transparent terminal, or one with pictures or colors superimposed on it, you'll need to change your .xinitrc to run aterm instead of xterm. You can use aterm -help to get *all* the options, but here are the most important ones:
| -geometry < geometry > | Just like for xterm. Size is in characters. |
| [+|-]rv | Set reverse video (black text on white). |
| -bg < color > | Set the background color |
| -fg < color > | Set the foreground color |
| -pixmap < file > | Choose a picture for the background |
| -bgtype < see help > | set how the background is displayed |
| -tinttype < see help > | set how background is displayed |
| -sh < number > | darken the background by < number > percent |
| -txttype < see help > | set how the text is drawn |
| -fade < number > | fade out by < number > percent when in background |
| [+|-]tr | set transparency of background |
| [+|-]trsb | set transparency of scrollbar |
| -name < string > | set name and title of window |
| -title < string > | |
| -cr < color > | cursor color |
| -pr < color > | pointer color |
| -bd < color > | border color |
| -sl < number > | number of lines stored to scroll back to |
Snow
Or, "Hey, it's snowing on his screen!"
This drives about half the people in the lab nuts, but the rest seem to enjoy their insanity. The program to run is xsnow, preferably in the background (so run xsnow & in a shell to start it, or add it to your .xinitrc file). There are lots of very simple options, so use man xsnow for more information. There's also xroach, but you usually run that on someone else's machine. :p
Screensavers/xlock
By default, the xlock command is run when you lock your display. It displays some animated patterns on your screen, and asks for your password if you move the mouse or press a key (back in the day, programs like this were used to prevent monitor burn-in, thus the name "screensaver"). By modifying your .fvwm2rc file (as described above), you can change what the window system does when you use the "xlock" menu option. You can change the options passed to xlock (to make it only use certain patterns, and change the speed or time between pattern changes), or replace it with a different program entirely (the Matrix screensaver has been pretty popular, but there are lots of others out on the internet).
The Shell
You can configure your shell to do lots of stuff. Tcsh is a very fully-featured program, and the scripting language bui< into it is capable of impressive tasks all on its own. Here's a few things you can do:
Running Programs Automatically
If you want the program to run every time you log in (even from telnet), add it to the *end* of ~/.cshrc. If you only want it to run when you login to a sunlab terminal or use exceed, add it to ~/.xinitrc, in the section where it talks about running programs in the background.
Just add a line that looks like this: < program name > < parameters > &
The ampersand (&) is very important -- it makes the program run in the background. Otherwise, your login will ha< until the program exits. That's very bad, because if you log out of the system, you won't be able to login and fix it, and you'll have to get a consultant to take the lines out of your .cshrc file.
Aliases
You probably won't find too many uses for them in CS15, but aliases are an extremely useful way to run commonly-used commands quickly, or to run a set of commands all at once. To create one, add a line like this to your .cshrc file:
alias < alias command > '< command to execute > ; < next command to execute > ; ... '
Then, you can run all those commands just by typing in the name you gave at the beginning of the line. So, if I want to be able to quickly compile a project, I could use this alias:
alias jc 'javac *.java'
And then, whenever I type jc in a shell, it runs javac *.java for me. Less typing, less time, less mistakes. Aliases can also run things in the background, or run multiple commands:
alias jcb 'javac *.java &'
alias makeTetris 'jc; java Tetris.App &'
Now, typing jcb would compile a program in the background, and makeTetris would compile all the java files in your current directory, and then run Tetris (assuming you're in the right directory). Note that aliases (and scripts, too) can use other aliases. There are lots of more complex things you can do with shell scripting and aliases; see man csh or man tcsh for details, ideas, and commands to use.
XEmacs
XEmacs, by comparison, is pretty easy to tweak. But you have to know where to look. Most of what you want to change is under "Options/Browse Faces..."
To change a value, middle-click on it and then type the new value into the text
entry line at the bottom of the screen. To change normal text and the color of
the background, edit "defau< (defau< face)". To change the highlighting
colors for your code, edit the "font-lock-XXXX-face" entries (they might be
listed as fl-XXXX-face). e.g., the color for
font-lock-comment-face is the color that your comments will be.
You can change the amount of highlighting by going to "Options/Syntax Highlighting". "Most" highlights *everything*; "Least" is pretty subtle -- just comments and function declarations. "Paren Hightlighing" marks pairs of brackets {} and parentheses () when you type them. You can turn off highlighting by turning off "Automatic" and deselecting "In This Buffer".
Don't forget to do "Options/Save Options" after you're done.
There are lots of other options, and you can pretty much code anything into it, since it's running a Lisp interpreter in real time (take CS51 if you want to know more gory details about functional programming and why emacs can emulate a turing machine). XEmacs features a fairly usable interactive help system (it's kinda techie-oriented, but it does tell you how to use it).
Random Useful Bits Of Information
You can get information on almost anything by running 'man < commandname > ', where commandname is the name of a program you want information on, or a file like .cshrc. Use the space key to go forward a page, b to go back one (just like you're using more).
For some reason, windows like to pop up in weird places, like halfway off the screen (especially NGP windows if you forget to call setLocation in your App class). If you can't see the title bar, just hold down Meta (that diamond key next to the space bar) and you can drag windows around without having to click on the title bar.
Hitting Num Lock over on the right side will make X Windows go all screwy (it locks all the windows in their current locations). Scroll Lock does fun things, too (like locking xterm windows so you can't scroll them). If you know how to turn this "feature" off, please tell me.
You can press the up and down arrows in a terminal window to scroll back and forth through commands you've typed recently (this is helpful when you're compiling over and over and over....). You can also add to a command (or erase part of it) once you've brought it back up. You can also see everything you've run in a shell by running the history command. You can run a command listed there by typing "! < number > ", where < number > is the number listed next to a command.
XEmacs has a lot of useful keyboard shortcuts, many of which are not listed in obvious places. The intro tutorial and Emacs Guide list most of them, but you can see *all* of them if you go into the Emacs Help menus by clicking on the "Help" icon and following the directions.
If you want to get your hands dirty, there are some good books on the shelves behind the consultant's seat about using UNIX. Feel free to grab one and start playing around. You probably won't break anything. Most TAs can also answer questions about UNIX on hours, but questions not directly pertaining to your assignments and how to write/compile/run them will be entertained only if the TAs aren't busy answering questions about CS15.
