Wrapper for Bitwarden https://github.com/bitwarden/cli and Rofi
This is a work in progress to get the BitWarden cli functionality in an easy Rofi menu. On selecting an entry, the password is copied to your clipboard for 5 seconds. During those 5 seconds, a notification is shown indicating which password you are copying at that time.
You can either execute the script from a terminal or by binding it to a key combination in your window manager.
bwmenu 0.4Usage: bwmenu [options] -- [rofi options]
Options: --help Show this help text and exit.
--version Show version information and exit.
--auto-lock Automatically lock the Vault seconds after last unlock. Use 0 to lock immediatly. Use -1 to disable. Default: 900 (15 minutes)
-c , --clear , --clear= Clear password from clipboard after this many seconds. Defaults: 5 seconds.
-C, --no-clear Don't automatically clear the password from the clipboard. This disables the default --clear option.
--show-password Show the first 4 characters of the copied password in the notification.
Quick Actions: When hovering over an item in the rofi menu, you can make use of Quick Actions.
Alt+r Resync your vault
Alt+u Search through urls Alt+n Search through names Alt+c Search through folders
Alt+t Copy the TOTP Alt+1 Autotype the username and password [needs xdotool (Xorg) / ydotool (Wayland)] Alt+2 Autotype the username [needs xdotool (Xorg) / ydotool (Wayland)] Alt+3 Autotype the password [needs xdotool (Xorg) / ydotool (Wayland)]
Alt+L Lock your vault
Examples:
Default options work well
bwmenu
Immediatly lock the Vault after use
bwmenu --auto-lock 0
Never lock the Vault
bwmenu --auto-lock -1
Place rofi on top of screen, like a Quake console
bwmenu -- -location 2
You can use bitwarden-rofi to auto type your username, password or both by using xdotool/ydotool to autofill forms. - Alt+1: Type username and password - Alt+2: Type only the username - Alt+3: Type only the password
Wayland Users: For autotyping to work in Wayland, you will need
ydotoolworking with root permissions (it needs access to /dev/uinput) without asking for password. For example, this can be achieved by adding this line invisudo:
your_username ALL=(ALL) NOPASSWD: /usr/bin/ydotool
Install the
bitwarden-rofiAUR package for the latest release or the
bitwarden-rofi-gitfor the current master.
xclip,
xseland/or
xdotool- wayland:
wl-clipboardand
ydotool
Install these required dependencies:
Gentoo Users: It appears Gentoo does not provide a kernel with
keyctl. If so, make sure to install this as well
Optionally install these requirements: - xclip, xsel, or wl-clipboard - xdotool or ydotool
Then download the script file and place it somewhere on your
$PATHand grant it the
+xpermission.
# Install for all users sudo install -D --mode=755 --group=root --owner=root bwmenu /usr/local/bin/bwmenuInstall for yourself
mkdir -p ~/.local/bin &&
cp bwmenu ~/.local/bin/bwmenu &&
chmod +x ~/.local/bin/bwmenu
Released under the GNU General Public License, version 3. See
LICENSEfile.
Copyright © 2018-2019 * Andreas Backx * Daniel Prado * Jonathan Raphaelson. * Magnus Bergmark * Matthias De Bie * Remy Rojas * Baptiste Pierrat * Nathan Wallace