FLUXBOX-MENU(5)

πŸ’… fluxbox-menu β€” the fluxbox(1) menu syntax, explained by your fave ✨

okay so this is FLUXBOX-MENU(5), part of the Fluxbox Manual β€” and bestie, it's literally just the syntax for fluxbox menus. that's it. that's the whole vibe. let's go πŸŽ€


🌸 NAME 🌸

fluxbox-menu β€” the menu syntax for fluxbox(1). periodt.


πŸ¦‹ SYNOPSIS πŸ¦‹

/usr/share/fluxbox/menu

~/.fluxbox/menu

~/.fluxbox/windowmenu

✨ SYNTAX ✨

Variable parameters get shown in emphasis: argument

Everything else you see is required verbatim β€” like, type it exactly. Whitespace is only needed to delimit words, but honestly adding more whitespace is totally fine, no cap.


πŸ’– DESCRIPTION πŸ’–

So there are two types of menus in fluxbox that you can configure. Two. iconic.

The first is the root menu, which normally appears when you right-click on the desktop.

Okay so β€” the first one is the ROOT MENU (or right-click menu), and it's usually bound to a right-click on the desktop, though you can absolutely change that binding in the keys file (fluxbox-keys(5)). This same syntax is used for the CustomMenu command, which is also mentioned in fluxbox-keys(5). iykyk.

Fluxbox installs a default root menu file in /usr/share/fluxbox/menu. You can also run fluxbox -i to confirm this location (cute little sanity check 🫢). Of course this system-wide menu can be customized for all users at once, but it's also possible to create an individual menu file for each user. By convention, users create a menu file in ~/.fluxbox/menu. Once you've created your own menu file, you'll want to make sure you properly declare this location in your init file so fluxbox knows where to look. See RESOURCES, below, for the deets.

The second type is the WINDOW MENU, which defines the contents of the menu that appears when you right-click on a window's titlebar or iconbar. This opens a menu file as defined by ~/.fluxbox/windowmenu. And if this file doesn't exist? fluxbox will copy in the default from /usr/share/fluxbox/windowmenu. slay, it provides πŸ’…

And the best part β€” you do not need to "reload" fluxbox after editing either menu file. The changes should be taken into account the next time you open the menu. no restart, no stress, we love to see it 😭


πŸ‘‘ ROOT MENU πŸ‘‘

The root menu must begin with a [begin] tag and end with an [end] tag, and every tag must be on its own line. non-negotiable bestie.

There are up to four fields in a menu line. They look like this:

[tag] (label) {command} <'icon'>

The <'icon'> field is always optional whenever it shows up below. If you do specify it, the icon will be scaled down and displayed in the menu right alongside the text label of the item. It must be in .xpm or .png format β€” those two, no others ⭐

Any line that starts with a # or ! is considered a comment and gets ignored by fluxbox. Also, in the label/command/filename fields you can escape any character. Using \\ inserts a literal back-slash into the label/command/filename field. escape queen behavior ✨

You may enter labels, commands, and icons using characters from any iconv(1) language/locale by specifying the encoding used via the [encoding] tag, detailed below.


🧚 Structural Tags 🧚

  • [begin] (title) β€” This tells fluxbox to start parsing the menu file. This tag is required for fluxbox to read your menu file β€” and if it can't find it, the system default menu is used in its place. The title appears at the top of the menu. And a [end] tag is required to end the menu. main character tag fr.
  • [submenu] (label) {title} <'icon'> β€” This tells fluxbox to create and parse a new menu, which gets inserted as a submenu into the parent menu. These menus are parsed recursively, so there's literally no limit to the number of levels or nested submenus you can have πŸŒ€ The label is the text that will appear in the parent menu, and the title is shown at the top of the submenu. If title is omitted, the title will be the same as the label. An [end] tag is required to end the submenu.
  • [end] β€” This tells fluxbox that it's at the end of a menu. This can either be a [submenu] or the [begin] tag of the main root menu. There must be at least one of these tags in your menu to correspond to the required [begin] tag, and one for each [submenu]. yes it's giving matching brackets, keep them balanced bestie πŸŽ€
  • [encoding] {encoding} β€” This begins an [encoding] section and specifies the string encoding of all strings until the matching [endencoding] tag. For a list of available encodings on your system, run iconv -l.
  • [endencoding] β€” This ends an [encoding] section. thank u for your service 🫢
  • [include] (path) β€” Parses the file specified by filename inline with the current menu. The path can be the full path to a file, or it can begin with ~/, which will be expanded into your home directory. If path is a directory, then all files in that directory are included. very "bring the whole group chat" energy πŸ’œ
  • [separator] β€” This will create a nice separation line. Useful for splitting up sections in a "pretty" way ✨ The optional comment is not displayed, but can be useful for internal documentation or script parsing of menu files.
  • [nop] (label) <'icon'> β€” 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. decorative. no function. just vibes πŸ’…

πŸš€ Applications πŸš€

  • [exec] (label) {command...} <'icon'> β€” Inserts a command item into the menu. When you select the menu item from the menu, fluxbox runs command... 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. πŸ”₯
⚠️ heads up bestie: processes only see environment variables that were set before fluxbox started (such as in ~/.fluxbox/startup). so don't come crying to me when your brand-new export isn't there 😭

πŸ› οΈ Fluxbox Functions πŸ› οΈ

  • [config] (label) <'icon'> β€” 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.
  • [reconfig] (label) <'icon'> β€” When selected this item re-reads the current style and menu files and applies any changes. This is useful for creating a new style or theme, as you don't have to constantly restart fluxbox every time you save your style. However β€” plot twist β€” fluxbox automatically rereads the menu whenever it changes. so like, it's giving backup plan πŸ’€
  • [restart] (label) {command} <'icon'> β€” This tells fluxbox to restart. If command is supplied, it shuts down and runs the command (which is commonly the name of another window manager β€” yes, this is the "switch WM" button πŸ‘€). If command is omitted, fluxbox restarts itself.
  • [exit] (label) <'icon'> β€” Inserts an item that shuts down and exits fluxbox. Any open windows are reparented to the root window before fluxbox exits. no windows were harmed in the making of this exit 🫢
  • [style] (label) {filename} <'icon'> β€” This tells fluxbox to insert an item that, when selected, reads style file named filename and applies the new textures, colors and fonts to the current running session. glow-up on demand ✨
  • [stylesmenu] (directory) <'icon'> β€” Reads all filenames from the specified directory, 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.
  • [stylesdir] (label) {directory} <'icon'> β€” Creates a submenu entry with label (that is also the title of the new submenu), and inserts in that submenu all filenames in the specified directory, assuming that they are all valid style files (directories are ignored) in the same way as the [stylesdir] command does. Both [stylesdir] and [stylesmenu] commands make it possible to install style files without editing your init file. literally so convenient, obsessed πŸ’–
  • [wallpapers] (directory) {command} <'icon'> β€” This inserts a menu item to set the wallpaper for each file in the given directory. The command is optional, and defaults to fbsetbg. wallpaper menu go brrr πŸ–ΌοΈ
  • [workspaces] (label) <'icon'> β€” This tells fluxbox to insert a link to the workspaces menu directly into your menu. See Workspace Menu in fluxbox(1) for details.
  • [command] (label) <'icon'> β€” In addition to the commands above, any legal keys file command may be used as a menu item. See fluxbox-keys(5) for more information. the whole keys file is your menu oyster πŸ¦‹

πŸ’€ WINDOW MENU πŸ’€

The syntax for the Window Menu is mostly identical to that for the ROOT MENU β€” it must start with [begin] and end with [end], and may have any of the above tags. However, it may also contain any of the following window-specific [tag*]*s, which each must be on a line by itself with no labels, commands, or icons. like, zero extras. just the tag, alone, thriving 🌸

The additional available tags in this menu are:

  • [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.

pick your button, pick your destiny πŸ’…

  • [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. gentle. polite. πŸŽ€
  • [kill] β€” Kills the window's process, like xkill(1). okay so this one is NOT graceful β€” it's the nuclear option bestie, use with intent πŸ’€
  • [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. rude of them, honestly 😭
  • [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. middle-click = you're coming with it 🫢
  • [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).
  • [separator] β€” Adds a horizontal line to the menu. the humble divider. iconic. ⭐

(part 1 done β€” more coming, don't go anywhere bestie πŸ’œ)

🌸 FILES 🌸

ok so here's where fluxbox keeps all its lil menu files, and honestly the paths matter so let's get them exactly right πŸ’–

  • ~/.fluxbox/menu β€” this is the default hangout spot for your root menu, like your own personal menu home 🏠
  • /usr/share/fluxbox/menu β€” this one's the system-wide root menu file. fluxbox uses it if your own root menu is missing or if it just can't be parsed (rip, unparseable menu 😭)
  • ~/.fluxbox/windowmenu β€” your personal window menu definition file, the one you actually get to customise ✨
  • /usr/share/fluxbox/menu β€” yep, same path listed again, and this time it's the default window menu. If you don't have your own window menu file, fluxbox will copy this one over to ~/.fluxbox/windowmenu on startup. Not me, that's just what it does 🫢

πŸŽ€ RESOURCES πŸŽ€

  • session.menuFile: location β€” set this to override where your root menu lives, lowkey a power move πŸ‘‘

πŸ’… ENVIRONMENT πŸ’…

k so the comand... field of the [exec] tag can absolutely take advantage of other environment variables β€” but ONLY if they're set before fluxbox is started. timing is everything bestie ⏰


πŸ¦‹ EXAMPLES πŸ¦‹

🌈 Root Menu

# fluxbox menu file
[begin] (fluxbox)
    [exec] (rxvt) {rxvt -ls} </usr/X11R6/share/icons/terminal.xpm>
    [exec] (netscape) {netscape -install}
    [exec] (The GIMP) {gimp}
    [exec] (XV) {xv}
    [exec] (Vim) {rxvt -geometry 132x60 -name VIM -e screen vim}
    [exec] (Mutt) {rxvt -name mutt -e mutt}
    [submenu] (mozilla)
        [exec] (browser) {mozilla -browser}
        [exec] (news) {mozilla -news}
        [exec] (mail) {mozilla -mail}
        [exec] (edit) {mozilla -edit}
        [exec] (compose) {mozilla -compose}
    [end]
    [submenu] (Window Manager)
        [exec] (Edit Menus) {nedit ~/.fluxbox/menu}
        [submenu] (Style) {Which Style?}
            [stylesdir] (~/.fluxbox/styles)
            [stylesmenu] (fluxbox Styles) {/usr/share/fluxbox/styles}
        [end]
        [config] (Config Options)
        [reconfig] (Reconfigure)
        [restart] (Restart)
    [end]
    [exit] (Log Out)
[end]

look at that whole vibe, it's giving organised main character energy πŸ’–

🌸 Default Window Menu

[begin]
  [shade]
  [stick]
  [maximize]
  [iconify]
  [raise]
  [lower]
  [settitledialog]
  [sendto]
  [layer]
  [alpha]
  [extramenus]
  [separator]
  [close]
[end]

that's the full starter pack, every single one of them, no cap ✨


πŸ‘‘ AUTHORS πŸ‘‘

giving credit where it's due, these are the legends who made this happen 🫢

  • Jim Ramsay <i.am at jimramsay com> (>fluxbox-1.0.0)
  • Curt Micol <asenchi at asenchi com> (>fluxbox-0.9.11)
  • Tobias Klausmann <klausman at users sourceforge net> (⟨fluxbox-0.9.11)
  • Grubert <grubert at users sourceforge net> (fluxbox)
  • Matthew Hawkins <matt at mh dropbear id au> (blackbox)
  • Wilbert Berendsen <wbsoft at xs4all nl> (blackbox)

⭐ SEE ALSO ⭐

fluxbox(1) fluxbox-keys(5) fluxbox-apps(5) xkill(1) iconv(1) β€” go read these too, iykyk πŸ“š


πŸ’œ AUTHOR πŸ’œ

Jim Ramsay <i.am@jimramsay.com>

  • Author.

ok that's literally the whole page bestie, you ate that πŸ’…βœ¨ this masterpiece was written by fluxbox-menu.txt, dated 08 February 2015, and it's serving FLUXBOX-MENU(5) realness β€” go forth and make the prettiest menus ever fr fr πŸŽ€πŸ¦‹πŸ’–

πŸ“¦ where this page comes from