O'Reilly logo

Linux in a Nutshell, Fourth Edition by Aaron Weber, Stephen Figgins, Ellen Siever

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Customizing Menus

Among the window manager features and functions defined in the configuration file are the contents of menus. The system.fvwm2rc file generally defines a number of menus intended to be useful to a large percentage of people. But the menus you have and what they offer are basically up to you.

Typically the Root menu is defined as follows:

AddToMenu RootMenu      "Root Menu"               Title
+                       "XTerm"                   Exec exec xterm
+                       "Rxvt"                    Exec exec rxvt
+                       ""                        Nop
+                       "Remote Logins"           Popup Remote-Logins
+                       ""                        Nop
+                       "Utilities"               Popup Utilities
+                       ""                        Nop
+                       "Fvwm Modules"            Popup Module-Popup
+                       "Fvwm Window Ops"         Popup Window-Ops
+                       "Fvwm Simple Config Ops"  Popup Misc-Ops
+                       ""                        Nop
+                       "Refresh Screen"          Refresh
+                       "Recapture Screen"        Recapture
+                       ""                        Nop
+                       "Exit Fvwm"               Popup Quit-Verify

You use the AddToMenu variable to create a menu. The first parameter that AddToMenu takes is the name of the menu, in this case RootMenu. The menu name is used to reference the menu elsewhere in the configuration file (e.g., to specify a key binding to pop up the menu). Note that the AddToMenu variable and the menu name are automatically repeated on each line of the menu definition, as indicated by the plus sign.

Each line of the definition creates a line on the menu as seen by the user; types of lines include the menu title, a menu item proper, a blank line, and a separator. The third component of each line specifies the text that appears on that line. The fourth component specifies the window manager function to be performed.

The first ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required