fluxbox-menu(5) =============== Jim Ramsay v1.3.1, 27 February 2011 :man source: fluxbox-menu.txt :man version: {revision} :man manual: Fluxbox Manual NAME ---- fluxbox-menu - fluxbox(1) menu syntax SYNOPSIS -------- @pkgdatadir@/menu.lua ~/.fluxbox/menu.lua ~/.fluxbox/windowmenu.lua SYNTAX ------ Variable parameters are shown in emphasis: 'argument' All other characters shown are required verbatim. Whitespace is only required to delimit words, but it is fine to add more whitespace. DESCRIPTION ----------- There are two types of menus in fluxbox which can be configured. The first is the *ROOT MENU* (Or right-click menu), is usually bound to a right-click on the desktop, though this binding can be changed in the `keys' file (*fluxbox-keys(5)*). This same syntax is used for the *CustomMenu* command, also mentioned in *fluxbox-keys(5)*. Fluxbox installs a default root menu file in *@pkgdatadir@/menu.lua*. You can also use fluxbox -i to confirm this location. Of course this system-wide menu can be customized for all users at once, but it is also possible to create an individual menu file for each user. By convention, users create a menu file in *~/.fluxbox/menu.lua*. Once you've created your own menu file, you'll want to make sure that you properly declare this location in your `init' file so that fluxbox knows where to look. See *RESOURCES*, below for details. The second type is the *WINDOW MENU*, which defines the contents of the menu which appears when you right-click on a window's titlebar or iconbar. This opens a menu file as defined by *~/.fluxbox/windowmenu.lua*. If this file does not exist, fluxbox will copy in the default from *@pkgdatadir@/windowmenu.lua*. You do not need to ``reload'' fluxbox after editing the menu file, the changes should be taken into account the next time you open the menu. ROOT MENU --------- The root menu is a lua script. You can use all lua features to construct your menu. Fluxbox is only interested in the return value of your script and will never overwrite this file. Here, we will describe the simplest case of the menu file, where you list the menu entries verbatim. Menu is a lua table containing entries specifying the menu title and menu items. The simplest menu.lua file looks like this: .... return { type = "menu"; title = "Fluxbox"; } .... It contains two entries: *type*, which signals that this is indeed a menu and *title*, which set's the title of the menu. It contains no menu items. Menu entries are also tables, but with different value of the *type* field. To add menu items to a menu, just list them (semicolon delimited) after all the 'key' *=* 'value' pairs. To see all possible menu types, read the following sections. Besides the type, all menu entries should contain the *label* field, which sets the text which is displayed on the menu item. They may also contain the *encoding* field, which specifies the encoding of the *label* field. You may enter the label in any *iconv(1)* locale by specifying the appropriate encoding. If the *encoding* field is empty, the value set in the parent menu is used. Each menu entry may also contain an *icon* field. If specified, the icon will be scaled down and displayed in the menu alongside the text label of the item. It must be in .xpm or .png format. Most entry types also expect a *param* field, which specifies additional properties of the menu item. Some entry types may support additional fields. These fields will be mentioned in the description of the particular menu type. Standard lua comments are used: everything from *--* to the end of the line is ignored. Block comments are enclosed in *--[[* and *]]*. MENU ITEM TYPES --------------- Special item types ~~~~~~~~~~~~~~~~~~ *separator*;; This will create a nice separation line. Useful for splitting up sections in a ``pretty'' way. The *label* field is ignored. *nop*;; Insert a non-operational item into the current menu. This is much like *separator*, but instead of a line, it inserts a label. This can be used to help format the menu into blocks or sections if so desired. The label is optional, and if omitted a blank item will be inserted. *menu*;; Inserts a submenu. The syntax is identical to that of the main menu. The *label* field sets the text in the parent menu, while *title* sets the title displayed at the top of the menu. Actions ~~~~~~~ *exec*;; Inserts a command item into the menu. When you select the menu item from the menu, fluxbox runs the command set by the field *param* in your *$SHELL* (or /bin/sh if $SHELL is not set). You can use this to launch applications, run shell scripts, etc. Since all arguments are passed verbatim to the shell, you can use environment variables, pipes, or anything else the shell can do. Be sure to escape the special characters properly as the string will be parsed by lua 'and' your shell. If you do not wan't lua to parse the string, quote the string using lua long brackets (*[[*'string'*]]*). Note that processes only see environment variables that were set before fluxbox started (such as in ~/.fluxbox/startup). *lua*;; Executes a lua code contained in *param* when the menu item is selected. The code can be given as a lua function, or a string, which will be compiled into a lua chunk. This function can then change fluxbox resources, modify keybindings, etc. *command*;; Any legal keys file command may be used as a *param* and will be executed when this menu item is selected. See *fluxbox-keys(5)* for more information. Fluxbox Functions ~~~~~~~~~~~~~~~~~ A number of special menu items may be used. These generally insert special menus or menu items and have their own default labels which are used if you do not specify one explicitly. *config*;; Inserts a fluxbox native submenu item, containing numerous configuration options concerning window placement, focus style, window moving style, etc. See *Configuration Menu* in *fluxbox(1)* for details. *exit*;; Inserts an item that shuts down and exits fluxbox. Any open windows are reparented to the root window before fluxbox exits. *style*;; This tells fluxbox to insert an item that, when selected, reads style file specified by *param* and apply the new textures, colors and fonts to the current running session. *stylesmenu*;; Reads all filenames from the specified directory specified by *param*, assuming that they are all valid style files, and creates inline menu items in the current menu for every filename, that, when selected by the user will apply the selected style file to the current session. The labels that are created in the menu are the filenames of the style files. *stylesmenu* makes it possible to install style files without editing your init file. *wallpapers*;; This inserts a menu item to set the wallpaper for each file in the directory given by *param*. The command for setting the wallpaper is specified by the *program* field, and defaults to *fbsetbg*. *workspaces*;; This tells fluxbox to insert a link to the workspaces menu directly into your menu. See *Workspace Menu* in *fluxbox(1)* for details. Window operations ~~~~~~~~~~~~~~~~~ These items alter properties of the active window. They also provide a default label if you don't put one. *shade*;; Provides a menu item to shade or unshade (or, roll-up) the window. This is equivalent to the shade titlebar button. *stick*;; Provides a menu item to stick or unstick the window. Stuck windows are displayed on all workspaces. This is equivalent to the stick titlebar button. *maximize*;; Provides a menu item to maximize or unmaximize the window, equivalent to the maximize titlebar button. The button with which you click alters the behaviour of this item as follows: * Button 1 (Un)Maximize as normal. * Button 2 (Un)Maximize window vertically. * Button 3 (Un)Maximize window horizontally. *iconify*;; Provides a menu item to iconify (or, minimize) the window, equivalent to the iconify titlebar button. *close*;; Closes the window gracefully, equivalent to the titlebar button. *kill*;; Kills the window's process, like *xkill(1)*. *raise*;; Raise the window to the top of the stack within its layer. *lower*;; Lower the window to the bottom of the stack within its layer. *settitledialog*;; Opens a dialog which can be used to set the window's title. Some applications may re-set their own title from time-to-time, wiping out your setting. *sendto*;; Sends the window to a different workspace. When you select the workspace with a middle-click, fluxbox will also change to the new workspace. A regular click only sends the window. *layer*;; Adds a ``Layer...'' submenu which lets you change the layer of this window. *alpha*;; Adds a ``Transparency...'' submenu which lets you change the focused and unfocused transparency of this window. *extramenus*;; Adds the ``Remember...'' menu item, which allows you to specify which settings should be stored in the `apps' file (See *fluxbox-apps(5)* for more details). WINDOW MENU ----------- The syntax the same as *ROOT MENU*, but the window menu usually contains only the window operation menu items. However, there is nothing stopping you from putting any other item there as well. FILES ----- *~/.fluxbox/menu.lua*:: This is the default location for the user's root menu. *@pkgdatadir@/menu.lua*:: This is the system-wide root menu file. It will be used if the user's root menu is missing or unparseable. *~/.fluxbox/windowmenu.lua*:: This is the user's window menu definition file *@pkgdatadir@/windowmenu.lua*:: This is the default window menu. If the user does not have this file, it will be copied to *~/.fluxbox/windowmenu* on fluxbox startup. RESOURCES --------- *session.menuFile =* 'location':: This may be set to override the location of the user's root menu. ENVIRONMENT ----------- The 'comand...' field of the *[exec]* tag can take advantage of other environment variables if they are set before fluxbox is started. EXAMPLES -------- .Root Menu .... return { type = "menu"; label = "fluxbox"; { type = "exec"; label = "rxvt"; param = "rxvt -ls"; icon = "/usr/X11R6/share/icons/terminal.xpm"; }; { type = "exec"; label = "netscape"; param = "netscape -install"; }; { type = "exec"; label = "The GIMP"; param = "gimp"; }; { type = "exec"; label = "XV"; param = "xv"; }; { type = "exec"; label = "Vim"; param = "rxvt -geometry 132x60 -name VIM -e screen vim"; }; { type = "exec"; label = "Mutt"; param = "rxvt -name mutt -e mutt"; }; { type = "menu"; label = "mozilla"; { type = "exec"; label = "browser"; param = "mozilla -browser"; }; { type = "exec"; label = "news"; param = "mozilla -news"; }; { type = "exec"; label = "mail"; param = "mozilla -mail"; }; { type = "exec"; label = "edit"; param = "mozilla -edit"; }; { type = "exec"; label = "compose"; param = "mozilla -compose"; }; }; { type = "menu"; label = "Window Manager"; { type = "exec"; label = "Edit Menus"; param = "nedit ~/.fluxbox/menu"; }; { type = "menu"; label = "Style"; title = "Which Style?"; { type = "stylesdir"; param = "~/.fluxbox/styles"; }; { type = "stylesdir"; param = "@pkgdatadir@/styles"; }; }; { type = "config"; label = "Config Options"; }; { type = "command"; label = "Reconfigure"; param = "reconfig"; }; { type = "command"; label = "Restart"; param = "restart"; }; }; { type = "exit"; label = "Log Out"; }; }; .... .Default Window Menu .... return { type = "menu"; { type = "shade" }; { type = "stick" }; { type = "maximize" }; { type = "iconify" }; { type = "raise" }; { type = "lower" }; { type = "settitledialog" }; { type = "sendto" }; { type = "layer" }; { type = "alpha" }; { type = "extramenus" }; { type = "separator" }; { type = "close" }; }; .... AUTHORS ------- - Jim Ramsay (>fluxbox-1.0.0) - Curt Micol (>fluxbox-0.9.11) - Tobias Klausmann (<=fluxbox-0.9.11) - Grubert (fluxbox) - Matthew Hawkins (blackbox) - Wilbert Berendsen (blackbox) SEE ALSO -------- fluxbox(1) fluxbox-keys(5) fluxbox-apps(5) xkill(1) iconv(1)