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 what menus you have, if any, and what they offer, are basically up to you.

Typically the Root menu would be defined:

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 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 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; that may be the menu title, a menu item proper, a blank line, or 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 line of our example specifies the menu ...

Get Linux in a Nutshell, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.