Basic FVWM Configuration
So, now that we've touched on the basics, let's put all of this together and create a sub-menu for our editors. Supposing that we wanted the menu title to be Editors and the Popup itself to be referred to as editors, then we could create something similar to the example given below:
Popup "editors" Title "Editors" Exec "XE&dit" exec xedit & Exec "X&Coral" exec xcoral & Exec "GNU &Emacs" exec emacs -g 84x47 & Exec "&XEmacs" exec xemacs & Exec "XW&PE" exec xwpe -font 9x15 & Exec "X&WE" exec xwe -font 9x15 & Exec "&aXe" exec axe -noserver & Exec "&NEdit" exec nedit & Exec "E&Z Editor" exec ez & EndPopup
So far so good, eh. What's that? What are those ampersands doing in the menu item name entry? Fvwm allows you to define keyboard shortcuts to use with menus. Placing an ampersand in an item name causes the letter following the ampersand to be underlined. Then, when the menu is displayed, hitting that underlined letter causes the program item to be executed.
In the menu defined above, the letter “d” in XEdit would be underlined and would appear as “XEdit”. Once the menu has been displayed, hitting a “d” launches xedit. It goes without saying that you should avoid defining the same hot-key for two items in the name menu.
Ok, we're almost done. Now that we've created a sub-menu, let's add this to the main menu. An entry for a sub-menu takes the form:
Popup "Editors" editors
Pretty easy, huh? The syntax should start to look pretty familiar to you by now. The line begins with the word “Popup” indicating the the item is a sub-menu of some kind. Following this, and enclosed in double quotes, is the item name that will appear on the menu. Finally, the last argument is the name of the pop-up menu itself. Remember that we decided to call the pop-up editors? This is the name by which the sub-menu is called. Be careful not to mix up the name of the pop-up menu with the title (e.g., “Editors”) that the menu uses.
Well, congratulations! You should now be well on your way to customizing and configuring. There are many more things that can be included on a pop-up menu although programs, modules, and sub-menus are probably the the ones you'll use the most. Once you get comfortable creating menu entries, skim over the fvwm manual page and take a look at the sample fvwmrc file that comes with the fvwm distribution to get ideas about what else can be done.
As a final word of exhortation let me suggest that “moderation in all things” is probably sage advice. It is unnecessary and unwise to create an entry for every program on your system. Add programs that you frequently use and make them accessible. Nesting sub-menus beyond one or two deep is likely to make getting at them more of a chore than it is worth. Also, more than 15 to 20 items on a single menu will probably make it a bit unwieldy. [Actually, experts in human-computer interaction suggest that the human mind is less efficient when dealing with more than 7 items (or groups of items) together. —ED] Use your discretion and divide things up if you need to. Most of all, though, have fun!
By now you should start feeling pretty good about fvwm. You've learned the basics of creating a start up desktop and you've re-organized and customized your pop-up menus. This is pretty good, eh? One of the next items on the customization to-do list is invariably colors. Like most everything associated with fvwm, colors are extensively customizable. Doing this, however, can be just a bit tricky, not because it's all that difficult, but because several entries govern how colors are applied to various programs and windows. Once you track all of these down, and understand a few simple concepts about how colors are defined, the rest is play. At the outset, however, it is helpful to know something about how fvwm views windows (no, not that Windows...).
Fvwm recognizes and makes a distinction between a couple of different “types” of windows. These include the “selected” window—that which has the input focus—“unselected” windows—those which do not have the input focus—and “sticky” windows—those which “stick to the glass” as it were. It is possible to customize the color scheme for each type of window. Parenthetically, let me also point out that it is easy to change the color of the root window or to use a bitmap or pixmap image in the root window as the “wallpaper”. In Part 1 of this series we saw that the xsetroot program allows you to change the color of the root window (see the sample .xinitrc file). There are much more fun and entertaining ways to change the root window, but I'll leave that up to you for the moment (hint: man xpmroot and man xv should give you some ideas...).
So, back to customizing the various windows. Fvwm allows you to individually customize selected, unselected, and sticky windows as well as menus and the pager. These are set using the following reserved words:
StdForeColor StdBackColor StickyForeColor StickyBackColor HiForeColor HiBackColor MenuForeColor MenuBackColor MenuStippleColor PagerForeColor PagerBackColor
ForeColor stands for the foreground color and BackColor stands for the background color. This is quite typical of how colors are designated under X—using a foreground/background combination to set the color scheme. A brief explanation of each of these is as follows:
StdForeColor foreground color for menus and non-selected window titles
StdBackColor background color for menus and non-selected window frames
StickyForeColor foreground color for non-selected sticky window titles
StickyBackColor background color for non-selected sticky window frames
HiForeColor foreground color for selected window's title
HiBackColor background color for selected window frame
MenuForeColor foreground color for menus
MenuBackColor background color for menus
MenuStippleColor color for shaded-out entries in a menu
PagerForeColor foreground color for pager
PagerBackColor background color for pager
Setting up the color scheme you want is a matter of adding an entry such as:
StdForeColor black StdBackColor wheat
This would set the foreground (text) color to black and the background color to wheat.
Armed with this new knowledge, you head off to customize colors, and find an entry that looks like:
If you're having a little trouble closing your eyes and visualizing just what the color #8a4510 might look like... ...keep reading.
Editorial Advisory Panel
Thank you to our 2014 Editorial Advisors!
- Jeff Parent
- Brad Baillio
- Nick Baronian
- Steve Case
- Chadalavada Kalyana
- Caleb Cullen
- Keir Davis
- Michael Eager
- Nick Faltys
- Dennis Frey
- Philip Jacob
- Jay Kruizenga
- Steve Marquez
- Dave McAllister
- Craig Oda
- Mike Roberts
- Chris Stark
- Patrick Swartz
- David Lynch
- Alicia Gibb
- Thomas Quinlan
- Carson McDonald
- Kristen Shoemaker
- Charnell Luchich
- James Walker
- Victor Gregorio
- Hari Boukis
- Brian Conner
- David Lane