7.6. Window Manager Menu Customisation   

The next frame shows the various menus that are used by later key and button definitions. For example, the "rootMenu" is shown when the right mouse button is clicked in the root window. (This is not hardwired in - I could have chosen the left mouse button or the middle mouse button when the Meta or Alt key is pressed - it is completely user definable ( remember though that there are certain historical conventions). ) How the root menu is tied to the appropriate button is also specified in this file - see later frame on button bindings. There we will explicitly tie the menus - rootMenu, clients and hosts - to the appropriate butons of the mouse.

As mentioned previously, this file contains a definition for the window menu specified in the ".Xdefaults" file: 4Dwm*windowMenu: 4DwmWindowMenu

    #####################################################################

#
# The following are the menu definitions used for 4Dwm. These will supersede the
# definitions in /usr/lib/X11/system.mwmrc.
# Menus that are defined in this file are not used by the window manager until
# they are explicitly specified as a target of an "f.exec" call.
# This may be done in a another menu definition, or a key or button binding definition.
# For example, the "rootMenu" definition below is referenced in our button binding
# definition farther below.
# In this way, any menu can be associated with any given context.
#
menu "rootMenu"
{
"root menu" f.title
"logout" f.exec "/usr/bin/X11/endsession"
no-label f.separator
"CNNews" f.exec "xwsh -name CNNews -geometry 80x40+152+102 -e /usr/local/bin/nn"
"backgrounds" f.menu backs
no-label f.separator
"refresh" f.refresh
"restart" f.restart
no-label f.separator
"kill 4Dwm" f.quit_mwm
}
menu backs
{
"Window Roots" f.title
"Default Root" f.exec "xsetroot -solid sgilightblue"
"lightblue Root" f.exec "xsetroot -solid sgibackgroundblue"
"Cross-weave Root" f.exec "xsetroot -def"
"Escher-Knot Root" f.exec "xsetroot -bitmap /usr/include/X11/bitmaps/escherknot -fg SGITeal -bg sgilightgray"
"Wingdogs Root" f.exec "xsetroot -bitmap /usr/include/X11/bitmaps/wingdogs -fg SGITeal -bg sgilightgray"
"Mensetmanuw Root" f.exec "xsetroot -bitmap /usr/include/X11/bitmaps/mensetmanus -fg SGITeal -bg sgilightgray"
"Tina Turner Root" f.exec "xsetroot -bitmap /usr/include/X11/bitmaps/woman -fg SGITeal -bg sgilightgray"
}
menu "clients"
{
"Console" f.exec "xwsh -title console -icontitle console -geometry 80x40+0-2 -fn
"snapshot" f.exec "snapshot -b"
"showmap" f.exec "showmap"
"makemap" f.exec "makemap"
"cedit" f.exec "cedit"
"snoop" f.exec "/usr/demos/bin/snoop"
"calendar" f.exec "/usr/sbin/ical &"
"camera alignment grid (grid)" f.exec "/usr/sbin/grid"
"color bars (colorbars)" f.exec "/usr/sbin/colorbars"
"gamma calibration field (gamcal)" f.exec "/usr/sbin/gamcal"
no-label f.separator
"xwsh" f.exec "/usr/sbin/xwsh &"
"xterm" f.exec "xterm -n `hostname` &"
no-label f.separator
"xmag" f.exec "xmag &"
"xclock" f.exec "xclock -analog -bg black -fg red -hd red -hl red&"
"xcalc" f.exec "xcalc &"
"xedit" f.exec "xedit &"
"xload" f.exec "xload -bg black -fg red &"
"xshowcmap" f.exec "xshowcmap &"
no-label f.separator
"display info (xdpyinfo)" f.exec "xwsh -geometry 80x24+110+427 -name 'X Query: Display Info' -hold -e /usr/bin/X11/xdpyinfo"
"window info (xwininfo)" f.exec "xwsh -geometry 80x24+110+427 -name 'X Query: Window Info' -hold -e /usr/bin/X11/xwininfo"
"properties (xprop)" f.exec "xwsh -geometry 80x24+110+427 -name 'X Query: Properties' -hold -e /usr/bin/X11/xprop"
"font names (xfontsel)" f.exec "/usr/bin/X11/xfontsel"
}
menu "hosts"
{
"xwsh: " f.exec "xwsh -name welcome -max 111x49 -geometry 80x40 -fn
}
#####################################################################
#
# Default Window Menu Description which has been explicitly overriden/redefined here to include different text
# for the menu items. This is then specified as the value for the 4Dwm*windowMenu resource in the ~4Dgifts/.Xdefaults file.
#
menu 4DwmWindowMenu
{
"pop" f.raise
"push" f.lower
"move" f.move
"resize" f.resize
"stow" f.minimize
"open" f.normalize
no-label f.separator
"close" f.kill
"quit" f.quit_app
}