2014-03-18 16:20:33 +00:00
bemenu
======
Dynamic menu library and client program inspired by dmenu
2014-03-18 17:31:50 +00:00
2020-02-08 09:21:39 +00:00
![preview ](.github/preview.svg )
2021-05-20 02:49:44 +00:00
## Releases
Releases are signed with [29317348D687B86B ](http://pgp.mit.edu/pks/lookup?op=vindex&search=0x29317348D687B86B ) and published [on GitHub ](https://github.com/Cloudef/bemenu/releases ).
2020-02-07 13:56:50 +00:00
## Building
```sh
# Build everything
make
# To build only certain features, pass the targets which you are interested into
#
# You can also use the following meta-targets for common features:
# - clients (bemenu, bemenu-run)
# - x11
# - wayland
# - curses
#
2020-02-08 10:25:06 +00:00
# For example this would build the bemenu and bemenu-run binaries and the x11 backend:
2020-02-07 13:56:50 +00:00
make clients x11
# To install the built features, simply run:
make install
# NOTE: You may get errors during install when not building all the features.
# These errors are free to ignore if `Install OK!` is printed.
2019-03-24 13:57:48 +00:00
2020-02-07 13:56:50 +00:00
# By default that will install to /usr/local, but you can change this with PREFIX
make install PREFIX=/usr
2019-03-24 13:57:48 +00:00
2020-02-07 13:56:50 +00:00
# Other usual variables are available for modifying such as DESTDIR, bindir, libdir and mandir
2020-02-07 21:34:41 +00:00
# Note that if you want a custom PREFIX or libdir, you should pass those during build as well,
2020-02-08 10:25:06 +00:00
# since they will be used compile-time to figure out where to load backends from!
2019-03-24 13:57:48 +00:00
2020-02-07 13:56:50 +00:00
# HTML API documentation (requires doxygen installed):
make doxygen
2020-02-08 09:31:06 +00:00
# To test from source, you have to point the LD_LIBRARY_PATH and BEMENU_RENDERERS variables:
LD_LIBRARY_PATH=. BEMENU_RENDERERS=. ./bemenu-run
2020-02-07 13:56:50 +00:00
```
2019-03-24 13:57:48 +00:00
2020-02-07 14:35:01 +00:00
## OSX
2022-10-07 04:55:16 +00:00
### Homebrew
2020-02-07 14:35:01 +00:00
```sh
2020-02-07 17:50:20 +00:00
# Make sure you have GNU Make and pkg-config installed
brew install make pkg-config
2020-02-07 14:35:01 +00:00
2020-02-07 17:50:20 +00:00
# You may need to setup your pkg-config to point to the brew version of the libraries
2020-02-08 10:25:06 +00:00
# For example to build curses backend, you'd do:
2020-05-07 05:48:22 +00:00
PKG_CONFIG_PATH="/usr/local/opt/ncurses/lib/pkgconfig" sh build-osx.sh curses
2020-02-07 14:35:01 +00:00
2020-05-07 05:48:22 +00:00
# Other than that, follow the normal build steps, but use `build-osx.sh` instead of make
2020-02-07 14:35:01 +00:00
```
2022-10-07 04:55:16 +00:00
### Nix
2023-08-29 15:04:02 +00:00
There is default.nix provided in this repo, you can install bemenu with it by running
2022-10-07 04:55:16 +00:00
```sh
2023-08-29 15:04:02 +00:00
nix-env -i -f default.nix
2022-10-07 04:55:16 +00:00
```
This installs only the curses backend.
2020-02-07 14:50:17 +00:00
## Dependencies
2021-12-27 16:53:57 +00:00
- C compiler
- scdoc to generate manpage
### Backend-specific
All dependencies below are searched with `pkg-config`
2020-02-07 14:50:17 +00:00
2020-02-08 10:25:06 +00:00
| Backend | Dependencies |
2020-02-07 15:27:40 +00:00
|----------|------------------------------------------------------------------------|
2020-02-08 09:26:33 +00:00
| curses | ncursesw |
2020-02-07 15:27:40 +00:00
| x11 | x11, xinerama, cairo, pango, pangocairo |
2020-02-12 10:14:57 +00:00
| Wayland | wayland-client, wayland-protocols, cairo, pango, pangocairo, xkbcommon |
2020-02-07 14:50:17 +00:00
2024-06-16 04:01:56 +00:00
Currently, pasting from clipboard is done at runtime with `wl-paste` and `xclip` , attempted in that order.
2021-11-01 19:16:45 +00:00
2021-11-23 19:10:47 +00:00
### Installing the dependencies
#### Ubuntu 20.04
```sh
2021-12-27 16:53:57 +00:00
sudo apt install scdoc wayland-protocols libcairo-dev libpango1.0-dev libxkbcommon-dev libwayland-dev
2021-11-23 19:10:47 +00:00
```
2020-02-07 13:56:50 +00:00
## Environment variables
| Variable | Description | Value |
|------------------|-----------------------------------------|----------------------|
2020-02-07 21:11:42 +00:00
| BEMENU_OPTS | Options for bemenu, bemenu-run from env | Any cli argument |
2020-02-08 10:25:06 +00:00
| BEMENU_BACKEND | Force backend by name | x11, wayland, curses |
| BEMENU_RENDERER | Force backend by loading a .so file | Path to the .so file |
| BEMENU_RENDERERS | Override the backend search path | Path to a directory |
2020-06-28 15:12:20 +00:00
| BEMENU_SCALE | Override the rendering scale factor | Float value |
2020-02-07 13:56:50 +00:00
## About Wayland support
Wayland is only supported by compositors that implement the [wlr-layer-shell ](https://github.com/swaywm/wlr-protocols/tree/master/unstable ) protocol.
Typically [wlroots ](https://github.com/swaywm/wlroots )-based compositors.
2019-03-24 13:57:48 +00:00
2020-10-16 19:32:19 +00:00
## Keybindings
2022-10-20 14:55:03 +00:00
### Default Bindings
2020-10-16 19:32:19 +00:00
| Key | Binding |
|---------------------|----------------------------------------------------------------|
| Left Arrow | Move cursor left |
| Right Arrow | Move cursor right |
| Up Arrow | Move to previous item |
| Down Arrow | Move to next item |
| Shift + Left Arrow | Select previous item |
| Shift + Right Arrow | Select next item |
| Shift + Alt + < | Select first item in actual list |
| Shift + Alt + > | Select last item in actual list |
| Shift + Page Up | Select first item in actual list |
| Shift + Page Down | Select last item in actual list |
| Page Up | Select first item in displayed list |
| Page Down | Select last item in displayed list |
| Tab | Move to next item |
| Shift + Tab | Select item and place it in filter |
| Esc | Exit bemenu |
| Insert | Return filter text or selected items if multi selection |
| Shift + Return | Return filter text or selected items if multi selection |
| Return | Execute selected item |
| Home | Curses cursor set to 0 |
| End | Cursor set to end of filter text |
| Backspace | Delete character at cursor |
| Delete | Delete character at cursor |
| Delete Left | Delete text before cursor |
| Delete Right | Delete text after cursor |
| Word Delete | Delete all text in filter |
| Alt + v | Select last item in displayed list |
| Alt + j | Select next item |
| Alt + d | Select last item in display list |
| Alt + l | Select previous item |
| Alt + f | Select next item |
| Alt + 0-9 | Execute selected item with custom exit code |
| Ctrl + Return | Select item but don't quit to select multiple items |
| Ctrl + g | Exit bemenu |
| Ctrl + n | Select next item |
| Ctrl + p | Select previous item |
| Ctrl + a | Move cursor to beginning of text in filter |
| Ctrl + e | Move cursor to end of text in filter |
| Ctrl + h | Delete character at cursor |
| Ctrl + u | Kill text behind cursor |
| Ctrl + k | Kill text after cursor |
| Ctrl + w | Kill all text in filter |
| Ctrl + m | Execute selected item |
2021-11-01 18:52:18 +00:00
| Ctrl + y | Paste clipboard |
2020-10-16 19:32:19 +00:00
2022-10-20 14:55:03 +00:00
### Vim Bindings
Vim bindings can be activated via the `--binding vim` option. All bindings are in vim
`normal` mode. When bemenu is started with vim bindings it will be in `insert` mode. By
pressing `escape` , `normal` mode can be activated.
**Note**: The default bindings can still be used for actions that do not have a separate
vim binding such as launching a program or pasting.
| Key | Binding |
|-------|-----------------------------------------------|
| j/n | Goto next item |
| k/p | Goto previous item |
| h | Move cursor left |
| l | Move cursor right |
| q | Quit bemenu |
| v | Toggle item selection |
| i | Enter insert mode |
| I | Move to line start and enter insert mode |
| a | Move to the right and enter insert mode |
| A | Move to line end and enter insert mode |
| w | Move a word |
| b | Move a word backwards |
| e | Move to end of word |
| x | Delete a character |
| X | Delete a character before the cursor |
| 0 | Move to line start |
| $ | Move to line end |
| gg | Goto first item |
| G | Goto last item |
| H | Goto first item in view |
| M | Goto middle item in view |
| L | Goto last item in view |
| F | Scroll one page of items down |
| B | Scroll one page of items up |
| dd | Delete the whole line |
| dw | Delete a word |
| db | Delete a word backwards |
| d0 | Delete to start of line |
| d$ | Delete to end of line |
| cc | Change the whole line |
| cw | Change a word |
| cb | Change a word backwards |
| c0 | Change to start of line |
| c$ | Change to end of line |
2021-04-26 14:20:35 +00:00
## Projects using bemenu
* [pinentry-bemenu ](https://github.com/t-8ch/pinentry-bemenu )
2014-03-18 17:31:50 +00:00
## License
2020-02-07 13:56:50 +00:00
2014-03-18 19:20:11 +00:00
* [GNU GPLv3 (or any later version) ](LICENSE-CLIENT ) for client program[s] and
other sources except library and bindings
* [GNU LGPLv3 (or any later version) ](LICENSE-LIB ) for library and bindings