Navid Sassan baa3146840 Clean up error handling, naming, and README accuracy
- config.py: warn and fall back to defaults on invalid keybinding
  fields instead of raising an unhandled ValueError
- clipboard.py: replace check=True with manual returncode check for
  a friendly error message instead of a raw traceback
- __main__.py: rename __handle_* to _handle_* (double-underscore
  name mangling is meaningless at module level)
- rofi.py: check that rofi is installed before launching
- history.py: warn on corrupted history file instead of silently
  returning empty
- README: fix install path (cd bw-menu/python), add name to
  available keybinding fields
2026-02-17 22:36:38 +01:00
2026-02-17 20:39:40 +01:00

bw-menu

A rofi/fzf frontend for Bitwarden via the rbw CLI.

Installation

# dependencies
sudo dnf install -y rofi fzf wl-clipboard # or xclip instead of wl-clipboard
cargo install rbw  # requires rbw >= 1.14.0

# install bw-menu
git clone https://git.navidsassan.ch/navid.sassan/bw-menu.git
cd bw-menu/python
uv sync

Usage

# interactive selection (rofi)
bw-menu select

# interactive selection (fzf)
bw-menu select --selector fzf

# select and print to stdout instead of clipboard
bw-menu select --field username --print

# list recent selections
bw-menu history list

# get password of last selected entry
bw-menu history get 0 --field password

# get username and print to stdout
bw-menu history get 0 --field username --print

Selectors

rofi

Runs in rofi's script mode. Recently used entries appear at the top with a clock icon. Custom input is disabled — only existing vault entries can be selected.

Default keybindings:

Key Action
Enter Copy password
Ctrl+Enter Copy username
Shift+Enter Copy totp
Escape Cancel

Keybindings are configurable — see Configuration for details.

fzf

Launches fzf in the terminal with fuzzy matching. Recently used entries appear at the top, prefixed with *. Sorting is disabled so history entries stay on top.

Key Action
Enter Select the highlighted entry and copy to clipboard
Ctrl-C / Esc Cancel without selecting

Options

Flag Description Default
--selector rofi|fzf Which selector UI to use rofi
--field password|username|totp|name Which field to retrieve (fzf / history) password
--print Print to stdout instead of clipboard off

The selected field is copied to the clipboard using wl-copy (Wayland) or xclip (X11). When --print is passed, the value is printed to stdout instead.

History

Selections are saved to $XDG_CACHE_HOME/bw-menu/history.json (defaults to ~/.cache/bw-menu/history.json), up to 10 entries. The most recent selection is at index 0.

Configuration

Config file location: $XDG_CONFIG_HOME/bw-menu/config.yaml (or config.yml), defaults to ~/.config/bw-menu/config.yaml.

keybindings:
  password: Return
  username: Control+Return
  totp: Shift+Return

Each entry maps a vault field to a rofi key name. Available fields: password, username, totp, name.

The first entry is bound to rofi's accept key (kb-accept-entry). Additional entries become custom keybindings (kb-custom-1, kb-custom-2, …).

Inspired by

Limitations

  • No collections support. Entries are displayed with their folder path (e.g. foldername/itemname), but Bitwarden collections are not shown. This is a limitation of rbw, which does not expose collection data.

Sway keybindings

Example keybindings for ~/.config/sway/config:

# open bw-menu selector
bindsym $mod+p exec bw-menu select

# copy password of last selected entry
bindsym $mod+Shift+p exec bw-menu history get 0 --field password

# copy username of last selected entry
bindsym $mod+Shift+u exec bw-menu history get 0 --field username
Description
Bitwarden Menu
Readme MIT 188 KiB
Languages
Python 100%