1
0
Fork 0
mirror of https://github.com/Cloudef/bemenu synced 2024-05-07 08:06:24 +02:00
Dynamic menu library and client program inspired by dmenu
Go to file
Sören Tempel 1475c3ce45 client: improve stripping of getline(3) newline
The previous version of this code operated under the assumption that
getline(3) lines are always \n\0 terminated. Unfortunately, this is not
the case as readline will return input which is not terminated with a
newline character if EOF is reached before encountering this newline. In
these cases, the code would falsely strip the last character. As an
example, consider the following bemenu invocation:

	printf foo | ./bemenu

This would start bemenu with `fo` instead of `foo` as a menu item. This
commit fixes this edge case and also hardens the loop body a bit by only
entering it if getline wrote more than zero characters to the buffer.
2021-04-04 19:03:52 +09:00
.github README: add preview 2020-02-08 11:21:39 +02:00
client client: improve stripping of getline(3) newline 2021-04-04 19:03:52 +09:00
doxygen html: add missing Doxyfile 2020-02-08 10:47:31 +02:00
lib Use -m option for setting monitor name and monitor + cleanup 2021-02-05 16:53:43 +09:00
man Rewrite manpage 2021-04-01 19:07:07 +09:00
.editorconfig Add .editorconfig 2018-04-08 11:05:52 -04:00
.gitignore .gitignore: Ignore everything 2020-02-07 16:04:01 +02:00
GNUmakefile Rewrite manpage 2021-04-01 19:07:07 +09:00
LICENSE-CLIENT Add license for client[s] 2014-03-18 20:12:00 +01:00
LICENSE-LIB Add license for library and binding[s] 2014-03-18 20:15:05 +01:00
README.md Document keybindings in README 2020-10-17 16:40:12 +09:00
VERSION fix the version to 0.5.0 2020-08-28 21:02:30 +09:00
bemenu.pc.in make: provide a .pc file 2020-02-08 10:49:22 +02:00
build-osx.sh make: osx uses install_name instead of soname ... 2020-05-07 14:48:22 +09:00

bemenu

Dynamic menu library and client program inspired by dmenu

preview

Building

# 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
#
# For example this would build the bemenu and bemenu-run binaries and the x11 backend:
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.

# By default that will install to /usr/local, but you can change this with PREFIX
make install PREFIX=/usr

# Other usual variables are available for modifying such as DESTDIR, bindir, libdir and mandir
# Note that if you want a custom PREFIX or libdir, you should pass those during build as well,
# since they will be used compile-time to figure out where to load backends from!

# HTML API documentation (requires doxygen installed):
make doxygen

# To test from source, you have to point the LD_LIBRARY_PATH and BEMENU_RENDERERS variables:
LD_LIBRARY_PATH=. BEMENU_RENDERERS=. ./bemenu-run

OSX

# Make sure you have GNU Make and pkg-config installed
brew install make pkg-config

# You may need to setup your pkg-config to point to the brew version of the libraries
# For example to build curses backend, you'd do:
PKG_CONFIG_PATH="/usr/local/opt/ncurses/lib/pkgconfig" sh build-osx.sh curses

# Other than that, follow the normal build steps, but use `build-osx.sh` instead of make

Dependencies

All dependencies are searched with pkg-config

Backend Dependencies
curses ncursesw
x11 x11, xinerama, cairo, pango, pangocairo
Wayland wayland-client, wayland-protocols, cairo, pango, pangocairo, xkbcommon

Environment variables

Variable Description Value
BEMENU_OPTS Options for bemenu, bemenu-run from env Any cli argument
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
BEMENU_SCALE Override the rendering scale factor Float value

About Wayland support

Wayland is only supported by compositors that implement the wlr-layer-shell protocol. Typically wlroots-based compositors.

Keybindings

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

License