Menus and functions

Menus and functions are quite similar from the viepoint of xfwm. A menu item defines an xfwm commands to be executed when the entry is clicked. A function also consists of a number of xfwm commands that are either executed directly or only on certain events. Functions can also be bound to keys or mouse buttons.

Table 12-1. Menus and functions

CommandDescriptionExample
+Adds an additional item to a menu or function(See below)
AddToMenu <mn> [<entry> <command>]Starts the definition of a menu, or extends an existing one. An & in the entry name will create a keyboard accelerator for the next character.

AddToMenu "user_menu"

+ "&Xterm" Exec xterm -e tcsh

AddToFunction <fn> [<condition> <command>]Starts the definition of a function, or extends an existing one

AddToFunc Move-or-Raise "I" Raise

+ "M" Move

+ "D" Lower

DestroyFunc <fn>Removes an unneeded functionDestroyFunc "Move-or-Raise"
DestroyMenu <mn>Removes an unneeded menuDestroyMenu "Utilities"
AddToMenu <mn> <title> TitleAdditional directive to the "AddToMenu" command to specify a title. The Title command makes sure that there is a separator after the title.AddToMenu "my_menu" "My Menu" Title

A function item definition takes an event as first argument (see example in the table). The event is either a mouse action or an option to immediately execute the item. The mouse events are only meaningfull if a function is bound to a mouse button.

Recognized conditions in function definitions are:

There are some special functions available in xfce. These functions can be customized in the same way as user defined menus.

By default a number of menus and functions are defined. They have no special meaning; they are just always defined when (re)starting xfwm. See XFwm Defaults for the default commands.