bemenu - dynamic menu inspired by dmenu(1)



bemenu - dynamic menu inspired by dmenu(1)


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]


bemenu is a dynamic menu for tty(4) (using ncurses(3)), X11 and Wayland, inspired by dmenu(1).

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

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.

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.


-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>

List items vertically 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

Hide filter text.


Prevent the display from changing height on filter.


Immediately return if there is only one item.


Use alternative key bindings. Available options: vim


Always fork(2) before executing the selections. Disabled by default when using the terminal backend.


Only display menu if there are items.


Print the selected items to standard output instead of executing them.

--scrollbar none|always|autohide

Specify when to show a scrollbar for vertical lists:

-e, --vim-esc-exits

Exit bemenu when pressing escape 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

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 it’s 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:


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.


bemenu supports keyboard commands to move around the list and edit the filter. In the following examples, C-x means <control-x>, M-x means <alt-x> and S-x means <shift-x>:

<cursor-up>, S-<cursor-left>, C-p, M-j, M-l

Highlight the previous item.

<cursor-down>, <tab>, C-n, M-h, M-k

Highlight the next item.

PageUp, M-v, M-u

Show the previous page of items, preserving the offset of the currently highlighted item, if possible.

PageDown, C-v, M-d

Show the next page of items, preserving the offset of the currently highlighted item, if possible.

S-M-<, S-PageUp

Highlight the first item in the list.

S-M->, S-PageDown

Highlight the last item in the list.


Copy the highlighted item to the filter.

<escape>, C-g

Terminate bemenu without printing items.

C-<carriage-return>, C-m

Print selected items and the currently highlighted one, and exit. Items are printed 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-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 character before the cursor.


Remove character at the cursor.

C-u, S-<delete>

Remove all characters before the cursor.


Remove all characters after the cursor.


Clear the filter.


Paste the clipboard.


Print selected items and exit with a custom error code 10 (M-1) through 18 (M-9), see EXIT STATUS.


Print selected items and exit with the custom error code 19, see EXIT STATUS.




bemenu ran successfully.


The user exited without selecting, or bemenu encountered an error.


The user specified a custom exit code with M-[0-9], see KEYBOARD COMMANDS.


dmenu(1), fork(2), ncurses(3), tty(4)

Pango Reference Manual,, August 20, 2020, Fonts â pango_font_description_from_string().


bemenu is written and maintained by Jari Vetoniemi <[email protected]> with the help of various contributors.

Updated 2024-01-29 - |