bemenu(1)

πŸŽ€ NAME πŸŽ€

bemenu β€” dynamic menu inspired by dmenu(1). Bestie, this is the bemenu(1) page from the General Commands Manual, and it’s literally the main character of dynamic menus. πŸ’…


✨ SYNOPSIS ✨

bemenu [-hCiKTvwx] [-I <index>] [-l <lines>] [-P <prefix>]
    [-p <prompt>] [--ifne] [--scrollbar none|always|autohide] [--binding
    vim] [--fork] [backend_options]

bemenu-run [-hCiKTvwx] [-I <index>] [-l <lines>] [-P <prefix>]
    [-p <prompt>] [--ifne] [--scrollbar none|always|autohide] [--binding
    vim] [--fork] [--no-exec] [backend-options]

πŸ’– DESCRIPTION πŸ’–

bemenu is a dynamic menu for tty(4) (using ncurses(3)), X11 and Wayland, inspired by dmenu(1). It’s giving β€œpicker but make it fashion,” and honestly? Obsessed. πŸ¦‹

It reads a list of newline-separated items from standard input and then presents them as a list, where you can select one or more of them. When you press carriage-return, the selected items are printed to standard output (one per line) and bemenu exits. Slay. ✨

Entering text will filter the items to those that match the input. If the number of items exceeds the size of the list, the items will be paginated. No cap, it just keeps things tidy. πŸŽ€

bemenu-run is a special-case invocation of bemenu, where the input is the list of executables under PATH and the selected items are executed. It’s the β€œrun it, bestie” mode. πŸ”₯


πŸ’… OPTIONS πŸ’…

Okay so here’s the full options lineup β€” every flag, every value, no skipping. Iykyk. 🌸

  • -h, --help β€” print a help message to standard output and exit.
  • -C, --no-cursor β€” disable all cursor events.
  • -I, --index <index> β€” highlight the item at index at the start. Indices start at 0. By default, the first item is highlighted.
  • -i, --ignorecase β€” filter items case-insensitively.
  • -K, --no-keyboard β€” disable all keyboard events.
  • -l, --list "<number> down|up" β€” list items vertically down or up with the given number of lines.
  • -P, --prefix <prefix> β€” display prefix before the highlighted item in a vertical list.
  • -p, --prompt <prompt> β€” defines the prompt text to be displayed to the left of the input field. Defaults to bemenu.
  • -s, --no-spacing β€” disable the title spacing on entries.
  • -T, --no-touch β€” disable all touch events.
  • -v, --version β€” print the bemenu version number to standard output and exit.
  • -w, --wrap β€” advancing past the end of the list returns you to the start.
  • -x, --password none|hide|indicator β€” specify how the filter text should be displayed:
    • none β€” display the input (the default).
    • hide β€” do not display any input.
    • indicator β€” replace input with asterisks.
  • --fixed-height β€” prevent the display from changing height on filter.
  • --accept-single β€” immediately return if there is only one item.
  • --auto-select β€” when one entry is left, automatically select it.
  • --binding β€” use alternative key bindings. Available options: vim
  • --fork β€” always fork(2) before executing the selections. Disabled by default when using the terminal backend.
  • --ifne β€” only display menu if there are items.
  • --single-instance β€” force a single menu instance.
  • --no-exec β€” print the selected items to standard output instead of executing them.
  • --scrollbar none|always|autohide β€” specify when to show a scrollbar for vertical lists:
    • none β€” never display a scrollbar (the default).
    • always β€” always display a scrollbar.
    • autohide β€” only display a scrollbar when the number of items exceeds the number of lines.
  • -e, --vim-esc-exits β€” exit bemenu when pressing escape in normal mode for vim bindings.
  • -N, --vim-normal-mode β€” start in normal mode for vim bindings.
  • -F, --filter β€” filter items for a given string before showing the menu. Affects --ifne and --accept-single

πŸ› οΈ Backend options πŸ› οΈ

Heads up bestie: these options are only available on backends specified in the parentheses. πŸ’€
  • -b, --bottom β€” (Wayland, X11) the list will appear at the bottom of the screen.
  • -c, --center β€” (Wayland, X11) the list will appear at the center of the screen. (wx)
  • -f, --grab β€” (Wayland, X11) show the bemenu window whilst reading the items.
  • -B, --border β€” (Wayland, X11) specify the width of the border in pixels around the menu.
  • --bdr β€” (Wayland, X11) specify the border color.
  • -R, --border-radius β€” (Wayland, X11) specify the radius of the border around the menu (0 = no curved borders).
  • -H, --line-height <height> β€” (Wayland, X11) specify the height in point size to make each entry.
  • --ch β€” (Wayland, X11) specify the height of the cursor (0 = scales with line height).
  • --cw β€” (Wayland, X11) specify the width of the cursor.
  • -m, --monitor <index> β€” (Wayland, X11) specify the monitor index where the list should appear. Monitor indices start at zero. The interpretation of the given argument depends on the utilized backend. With X11 and Wayland, a value of -1 or focused indicates that the current monitor should be used (the default). With Wayland, the index should be a string specifying a specific monitor name. The value -2 or all indicates that the list should appear on all monitors.
  • -n, --no-overlap β€” (Wayland) set the bemenu window to be on top of any other panels.
  • -M, --margin <margin> β€” (Wayland, X11) specify the margin (empty space) in pixels to leave between menu and vertical view borders. bemenu will reduce its size to fit in space between gaps.
  • --hp β€” (Wayland, X11) specify the horizontal padding for the entries in single line mode.
  • -W, --width-factor <factor> β€” (Wayland, X11) specify the relative width factor as a floating point number. It makes sense to set it between 0 and 1 to define how much of the screen width bemenu will use. However, bemenu will still respect margin, so if resulting size is greater than space between gaps, bemenu will ignore factor and use available space instead.
  • --fn <name [size]> β€” (Wayland, X11) specify the font family name and size to be used. For more options, consult the Pango Reference Manual for pango_font_description_from_string().

The following options control the colours for various parts of the list for the Wayland and X11 backends. Each takes an argument in the form of #RGB[A], where R, G, B and A are hexadecimal integers from 00–FF that control the red, green, blue and alpha-transparency channels. 🌈

  • --tb <color> β€” title background.
  • --tf <color> β€” title foreground.
  • --fb <color> β€” filter background.
  • --ff <color> β€” filter foreground.
  • --cb <color> β€” cursor background.
  • --cf <color> β€” cursor foreground.
  • --nb <color> β€” normal background.
  • --nf <color> β€” normal foreground.
  • --hb <color> β€” highlighted background.
  • --hf <color> β€” highlighted foreground.
  • --fbb <color> β€” feedback background.
  • --fbf <color> β€” feedback foreground.
  • --sb <color> β€” selected background.
  • --sf <color> β€” selected foreground.
  • --ab <color> β€” alternating background color.
  • --af <color> β€” alternating foreground color.
  • --scb <color> β€” scrollbar background.
  • --scf <color> β€” scrollbar foreground.

⌨️ KEYBOARD COMMANDS ⌨️

okay so bemenu is fully keyboard-driven and honestly that's the vibe πŸ’… β€” you've got commands to scoot around the list and to edit your filter. quick legend before we go, because the notation is a whole thing: C-x means Ctrl+x, M-x means Alt+x, and S-x means Shift+x. periodt. ✨

  • <cursor-up>, S-<cursor-left>, C-p, M-j, M-l β€” highlight the previous item, slay ⬆️
  • <cursor-down>, <tab>, C-n, M-h, M-k β€” highlight the next item, keep it moving ⬇️
  • PageUp, M-v, M-u β€” show the previous page of items, and it preserves the offset of the currently highlighted item if possible (keyword: if possible, bestie, don't come for me) πŸ¦‹
  • PageDown, C-v, M-d β€” show the next page of items, same deal β€” offset of the currently highlighted item preserved if possible πŸ¦‹
  • S-M-<, S-PageUp β€” highlight the first item in the list, back to the top we go πŸ‘‘
  • S-M->, S-PageDown β€” highlight the last item in the list, bottom of the barrel bestie πŸ”₯
  • S-<tab> β€” copy the highlighted item into the filter. literally so useful 😭
  • <escape>, C-g β€” terminate bemenu without printing items. we're leaving, no receipts πŸ’€
  • C-<carriage-return>, C-m β€” print the selected items and the currently highlighted one, then exit. items print in the order they were selected, with the currently highlighted item printed last πŸŽ€
  • S-<carriage-return>, Insert β€” print the filter text to standard output and exit ✨
  • C-b, C-l, <cursor-left> β€” move cursor left
  • C-f, <cursor-right> β€” move cursor right
  • C-a, Home β€” move cursor to the start
  • C-e, End β€” move cursor to the end
  • <backspace>, C-h β€” remove the character before the cursor
  • <delete> β€” remove the character at the cursor
  • C-u, S-<delete> β€” remove all characters before the cursor
  • C-k β€” remove all characters after the cursor
  • C-w β€” clear the filter, fresh start energy 🌸
  • C-y, C-Y β€” paste selection (C-y for "primary", C-Y for "clipboard"). yes those are different, no you may not mix them up 🫢
  • M-[1-9] β€” print selected items and exit with a custom error code 10 (M-1) through 18 (M-9), see EXIT STATUS. custom codes, main character behaviour πŸ’…
  • M-0 β€” print selected items and exit with the custom error code 19, see EXIT STATUS

🌈 Vim bindings 🌈

so if you invoke bemenu with --binding vim, you get vim-like modal entry β€” these bindings roughly emulate insert and normal vim modes. the initial mode is insert mode, unless --vim-normal-mode is specified. iykyk 🧚

insert mode

in insert mode, all the keys up top function exactly as described above, except for this one:

  • <escape> β€” switch to normal mode. welcome to normal mode bestie 🌸

normal mode

in normal mode, only the following keys have meaning. everything else? crickets. πŸ™ˆ

  • q β€” terminate bemenu without printing items
  • i β€” enter insert mode
  • I β€” enter insert mode after moving the cursor to the start
  • a β€” enter insert mode after moving the cursor right
  • A β€” enter insert mode after moving the cursor to the end
  • cc β€” enter insert mode after clearing the filter
  • cw β€” enter insert mode after removing all characters between the cursor and the start of the next word
  • cb β€” enter insert mode after removing all characters between the start of the word and the cursor
  • c$ β€” enter insert mode after removing all characters after the cursor
  • c0 β€” enter insert mode after removing all characters before the cursor
  • n, j β€” highlight the next item
  • p, k β€” highlight the previous item
  • gg β€” highlight the first item in the list
  • G β€” highlight the last item in the list
  • H β€” highlight the first visible item
  • M β€” highlight the middle-most visible item
  • L β€” highlight the last visible item
  • v β€” select or deselect the highlighted item
  • F β€” show the next page of items
  • B β€” show the previous page of items
  • h β€” move cursor left
  • l β€” move cursor right
  • 0 β€” move cursor to the start
  • $ β€” move cursor to the end
  • w β€” move cursor forward to the start of a word
  • b β€” move cursor backward to the start of a word
  • e β€” move cursor forward to the end of a word
  • x β€” remove the character at the cursor
  • X β€” remove the character before the cursor
  • dw β€” remove all characters between the cursor and the start of the next word
  • db β€” remove all characters between the start of the word and the cursor
  • d$ β€” remove all characters after the cursor
  • d0 β€” remove all characters before the cursor
  • dd β€” clear the filter

🌱 ENVIRONMENT 🌱

env vars, bestie, the little knobs that change everything πŸŽ€ (the original put these in a cute little box, we're doing bullets because bullets ate):

  • BEMENU_OPTS β€” an alternative way to pass command line arguments to bemenu. sneaky and iconic ✨
  • BEMENU_BACKEND β€” force a backend to be used. if empty, one of the GUI backends (Wayland, X11) will be selected automatically. the accepted values are curses, wayland and x11.
  • BEMENU_RENDERER β€” force a backend by loading its shared object from the set value πŸ‘‘
  • BEMENU_RENDERERS β€” override the backend search path to the set value. defaults to /usr/lib64/bemenu. no cap, that's the path πŸ¦‹
  • BEMENU_SCALE β€” override the rendering scale factor for the GUI backends. make it big, make it small, it's giving control πŸ’…

πŸ’€ EXIT STATUS πŸ’€

  • 0 β€” bemenu ran successfully. we love a happy ending πŸ’–
  • 1 β€” the user exited without selecting, or bemenu encountered an error. two very different moods, same number 😭
  • 10-19 β€” the user specified a custom exit code with M-[0-9], see KEYBOARD COMMANDS. yes you can pick your own number, diva behaviour πŸ”₯

🫢 SEE ALSO 🫢

also the Pango Reference Manual, https://developer.gnome.org/pango/1.46/, August 20, 2020, Fonts β€” pango_font_description_from_string(). go read it, it's right there 🌈


πŸ‘‘ AUTHORS πŸ‘‘

bemenu is written and maintained by Jari Vetoniemi <mailroxas@gmail.com> with the help of various contributors. absolute icons, all of them πŸŽ€


and that's the page!! πŸ¦‹ this build is the 2024-07-19 version of bemenu(1) β€” go forth and pick your items, bestie, mwah πŸ’œ

πŸ“¦ where this page comes from