Linux command
bemenu 命令
文本
涉及管道、覆盖或删除,执行前请先确认路径和参数。
常用示例
Display a menu
echo -e "option1\noption2\noption3" | bemenu
Display a menu with a prompt
echo -e "firefox\nchromium\nvivaldi" | bemenu -p "Browser:"
Run selected command
echo -e "firefox\nchromium" | bemenu | xargs -r swaymsg exec --
Use as a program launcher
dmenu_path | bemenu | sh
Customize appearance
bemenu --fn "monospace 12" --tb "#285577" --tf "#ffffff"
List installed applications
compgen -c | sort -u | bemenu
Password prompt
bemenu --password -p "Password:"
说明
bemenu is a dynamic menu library and client program inspired by dmenu. It reads items from stdin, presents them in a menu, and outputs the selected item to stdout. It supports multiple backends including Wayland, X11, and curses. Unlike dmenu which only works on X11, bemenu provides native Wayland support, making it ideal for Sway and other Wayland compositors. The rendering is handled through backend libraries, allowing the same interface across different display servers. bemenu-run is a wrapper that lists executables from PATH and runs the selected one, functioning as a simple application launcher.
参数
- -p, --prompt _text_
- Set the prompt text.
- -i
- Case-insensitive matching.
- -l, --list _lines_
- Show items in a vertical list.
- -b, --bottom
- Display at bottom of screen.
- -m, --monitor _index_
- Show on specific monitor.
- -H, --line-height _height_
- Set item height in pixels.
- --password
- Hide input (password mode).
- -w, --wrap
- Wrap cursor selection.
- -f, --filter _text_
- Filter items for given text.
- --fn _font_
- Set font (Pango format, e.g., "monospace 12").
- --tb _color_
- Title bar background color.
- --tf _color_
- Title bar foreground color.
- --fb _color_
- Filter background color.
- --ff _color_
- Filter foreground color.
- --nb _color_
- Normal item background.
- --nf _color_
- Normal item foreground.
- --hb _color_
- Highlighted item background.
- --hf _color_
- Highlighted item foreground.
FAQ
What is the bemenu command used for?
bemenu is a dynamic menu library and client program inspired by dmenu. It reads items from stdin, presents them in a menu, and outputs the selected item to stdout. It supports multiple backends including Wayland, X11, and curses. Unlike dmenu which only works on X11, bemenu provides native Wayland support, making it ideal for Sway and other Wayland compositors. The rendering is handled through backend libraries, allowing the same interface across different display servers. bemenu-run is a wrapper that lists executables from PATH and runs the selected one, functioning as a simple application launcher.
How do I run a basic bemenu example?
Run `echo -e "option1\noption2\noption3" | bemenu` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -p, --prompt _text_ do in bemenu?
Set the prompt text.