mattydebie / bitwarden-rofi Goto Github PK
View Code? Open in Web Editor NEWWrapper for Bitwarden https://github.com/bitwarden/cli and Rofi
License: GNU General Public License v3.0
Wrapper for Bitwarden https://github.com/bitwarden/cli and Rofi
License: GNU General Public License v3.0
When using the xdotool to autotype, null gets prepended to the username and password
Hi
Just discovered the tool and it will be super useful ! Great work.
While using it, I observed a strange behaviour when switching between the by names or by folders search.
If I switch from by names to by folders and then switch back to by names, the app just closes itself.
Version used: 0.4
Regards
It seems that jq query supports only login type. It would be nice if it can support secure notes too :)
As the name suggests. would it be possible to add a theme flag that would then be passed to rofi to use an existing theme?
jq: error: Invalid escape at line 1, column 11 (while parsing '"\b"') at <top-level>, line 1:
.[] | select(.name == "fooDomain\barUser").login
jq: 1 compile error
Simply put: name
is not a unique id in bitwarden, and shouldn't be used to retrieve items.
Eg. https://github.com/mattydebie/bitwarden-rofi/blob/master/bwmenu#L97
id
should be used instead.
Problem is I'm not sure rofi can hide part of the input it's been given...
For bwmenu
to open it takes 1.09s on my machine.
$ time bwmenu # holding esc
bwmenu 1.09s user 0.10s system 156% cpu 0.764 total
This can get quite annoying sometimes, when searching immediately for an entry but passing the text in the application input-field and not Rofi's.
I didn't have this issue with rofi-pass.
Maybe the entry(-names) could be cached?
Since the latest bitwarden-cli 2023.12.0-1
Arch package, I have not been able to unlock my BW session using my master password. Downgrading to bitwarden-cli 2023.10.0-1
resolved the issue.
Currently I have the issue that when I open bwmenu
all the sites for which I have a password are visible. This is a privacy issue for me and I don't want others to be able to see it. My idea was to use the -lines
option rofi enables, but I can't pass rofi options to bwmenu
.
bwmenu
could parse all arguments rofi accepts and pass them to the rofi call.
If I have some time I'll gladly work on implementing this, but I'd like to get an approval from the project maintainers first.
After the latest upgrade to bitwarden-cli, I am not able to unlock the vault thru rofi
I've been working on a fork to add some things that I wanted.
xsel
instead of just xclip
. (#3)I've implemented step 2-4 via CLI options in my fork. If you merge #2 and #3, then I could open another PR with those changes applied too.
Let me know if you are interested! I'm not opening them right now because of the requirement on #2 and #3. If either of them are rejected, I could rebase my changes and try to open on top of your own master
.
[EDIT]: Here's a link to show the commits that would be included in such a PR: Mange/bitwarden-rofi@35d05ed...options
Let say I have 2 account at domain.com. When I press Alt+1 username and password of both accounts were filled in username and password input box
While trying to call bwmenu
I got:
keyctl_set_timeout: Permission denied
keyctl_read_alloc: Permission denied
Previous thread: #28
I get this error a few times a week, when this happens calling bitwarden-rofi will only show a small dialog with this message("Could not load items"). Is there any way to recover from this error(maybe restarting some service)? right now the only solution I found is to reboot.
I'm getting the error "could not load items". I've made sure to install all the dependencies, and I have successfully logged into bitwarden-cli. I've checked to make sure that both bw and rofi work, and they both do.
Is there anything else that I'm supposed to do that I missed?
I'm currently running Gentoo if that helps.
Now that we depend on lib/helper.sh
, we also need to install that to a place on users' filesystem.
Right now we expect the file to be in $PWD/lib/helper.sh
which is not the correct place when installing bwmenu to /usr/bin/bwmenu.
As the title says. I entered a new password in the web vault, then synced bitwarden-rofi
.
Upon syncing, bitwarden-rofi
instantly closed. The error showed up after attempting to open it again. Then I opened it through a terminal to see if perhaps any error messages would print out, however; there were simply none.
Everything was working perfectly before the sync, so something about the sync broke it?
Hi! Let me start by thanking you for the script! Now, this is a strange one...
I was facing an odd behavior when pressing alt+1/2/3 for autotyping: sometimes, half the characters were garbage; sometimes, apparently random keys got pressed (like esc, enter, etc).
It took me a while to understand what was happening: when xdotool begin to input characters, the user thumb may still be resting on the alt key, resulting in strange inputs.
Now, I'm guessing that this sleep
Line 222 in a53cc1e
I upgraded to rofi 1.7.0 yesterday, and was referred to bitwarden-rofi today. I had my own wrapper around bw
(using rofi`); but I like yours much better :-) Thank you!!
I get warnings every time I run bwmenu
:
** (process:417947): WARNING **: 18:47:10.356: /home/wwalker/.config/rofi/config.rasi:6:55: Option: lines is not found.
** (process:417947): WARNING **: 18:47:10.356: /home/wwalker/.config/rofi/config.rasi:14:21: Option: width is not found.
This is because rofi moved lines and width (and other config options) into the <theme>.rasi
in version 1.7.0.
getting could not unlock vault error.
I installed it using the AUR.
I've been using the great tool for a day now and I feel like I'm not seeing all of the information that I want to see or that it's not searching for the information I want it to search for. The Bitwarden's apps all search everywhere and then show this information in an overview similar to this:
---------
|favicon| Entry name
| | Username
---------
The favicon gives away what website it's from, so without a GUI we can replace that with the domain (e.g. accounts.google.com). The entry name and username is something we can easily show. If this information is all shown at once, I assume we can search for it with rofi. Could this behaviour be added so there is 1 search bar that will get you everthing you need?
If we could fire up bwmenu
with --item-format
that would allow you to input a string that is then formatted and allows for a few parameters:
%name
: Name of the password entry.%username
: Username on the service.%website
: Hostname of the website (github.com shortened from https://github.com/login, same as the Bitwarden extension shows).%type
: login, card, identity, or secure note.%folder
: the folder it is in.This would allow for everyone to search for what he needs and not even show what they don't want because it is configurable. Perhaps if it is possible, we could have a separate search list that contains everything and then only show some part of that information. E.g.: for the entry for account.google.com with [email protected] and entry name Private, we could search for "Private", "google", or "[email protected]" (or combine them) and all see the entry we're looking for, but then configure it to only show "[email protected] (account.google.com)".
I intend to publish this project on the AUR (unless you want to do it yourself).
Before I do that, I'd prefer if you could tag a release so I can use that release tarball as the source for the package version (and to keep them in sync). Would you mind tagging a release that I can base the package on?
I could also go for a bitwarden-rofi-git
package that always takes latest master
, but I prefer stable fixed-in-time versions for my package managers.
I can send you a PR afterwards with some updated instructions in the README about this.
Hi,
I'd love to switch to this but when I type the hotkey in i3 the entire desktop freezes (Mouse is working but I cannot click anything and only alt+ctrl+f2 is working on the keyboard) .. when I kill rofi-menu waiting for password (I can see the process but I cannot see the question asking to type in my password). After a reboot it works the first time and then next just freezes .. any idea on what it could be ?
I used the bwmenu for a few weeks now all went fine and I was quite happy. But last couple of days it failed on me, I was asked for my Master Password and only got the message in rofi stating
Could not load items
after some research I tried the keyctl commands but without success. So I digged a little deeper and started looking into the code. I came to the conclusion the ask_password function was giving me a session hash with the error message 'mac failed' included.
This seemed to be the culprit since obviously that wasn't a valid session hash, as I understood this has something to see with some corrupt entries in my vaultwarden, although I don't see any errors in the vaultwarden server neither in the CLI commands I use or the mobile app nor the firefox plugin.
As a workaround I changed the unlock command to redirect it's stderr to /dev/null which now circumvents the issue.
ask_password() {
rm $CACHE_FILE
mpw=$(printf '' | rofi -dmenu -p "Master Password" -password -l 0 ${ROFI_OPTIONS[@]}) || exit $?
if ! out="$(bw --raw --nointeraction unlock "$mpw" 2>/dev/null)"; then
exit_error 1 "Could not unlock vault: $out"
fi
echo "$out"
}
ask_password() {
rm $CACHE_FILE
mpw=$(printf '' | rofi -dmenu -p "Master Password" -password -l 0 ${ROFI_OPTIONS[@]}) || exit $?
if ! out="$(bw --raw --nointeraction unlock "$mpw" 2>&1)"; then
exit_error 1 "Could not unlock vault: $out"
fi
echo "$out"
}
yet I'm wondering if we should tackle this in the ask_password function to only fetch the session hash and if by any chance someone could point me in the direction how to fix the mac failed
issue in the first place?
How do I change the keybindings? In most of the WMs, alt+(1-9) keys are used to change workspace.
Thank you in advance.
Maybe I'm just blind or dumb, but I'm having a hard time making bwmenu use my custom rofi theme.
This is my command to open my launcher.
bindsym $mod+d exec killall dunst; exec rofi -no-config -no-lazy-grab -show drun -modi drun -show-icons -theme ~/.config/rofi/shack.rasi
I'm not sure how to translate that over to bwmenu
bindsym $mod+s exec bwmenu -theme ~/.config/rofi/shack.rasi ?
Hi,
I am using the script on Linux (EndeavourOS with i3) and it stopped working a few days ago.
Now when I run it, and after enter the password to unlock my vault, the "could not load items" error appears.
Any idea on how to solve this, please?
Thanks in advance.
Hi there, thanks for making this tool, I find it very useful.
Is there any chance that the AUTOTYPE_MODE
variable can be set via an environment variable?
My setup uses ydotool
, but without using sudo
, and thus bwmenu autotype does not work (as it requests the sudo password). Perhaps with the following patch, users could set their own typing tools.
# Stores which command will be used to emulate keyboard type
-AUTOTYPE_MODE=
+AUTOTYPE_MODE=$BWMENU_AUTOTYPE_MODE
the error and master password prompt should respect the rofi arguments passed by the user
Hey, I was wondering if there could be an option for auto-locking the vault after N minutes? Or even locking it after the Rofi prompt closes.
Thanks!
When run before bw login
, bwmenu fails with "could not unlock vault".
Feature request: when run before bw login
, bwmenu asks for an email (bonus: asks for a server) and master password and run bw login
itself.
Howdy,
One one my primary uses of Bitwarden is storing SSH credentials as secure notes. With that being mentioned, bitwarden-rofi doesn't appear to list secure notes. I've tried navigating to the folder itself in using the application however it appears to exclude them. I'm assuming since the secure notes aren't in a specific/standard format that this is an issue for bitwarden-rofi?
bwmenu requires keyutils
to be installed (for keyctl
), however it is not mentioned in the README.
i have for example digitialocean and github totp stored in bitwarden
im logged in with bw cli
everything works as expected but i don't get the Alt+t option to copy the totp
bwmenu --version
bwmenu 0.4
bw --version
1.12.1
Hi friends, thanks for this awesome work.
Im trying to run the program in a pure wayland envoirment (sway + wofi), it is compatible? i still getting the couldnt open display error... Thanks in advise :)
I recently had my laptop run out of battery, and since rebooting I can no longer log in with rofi. After entering the password it simply shows a box "Could not load items:".
Worth noting that running bwmenu
in a terminal prints the following:
~
❯ bwmenu
rm: cannot remove '/tmp/bwmenu/logins.gpg': No such file or directory
Any help would be appreciated!
Hey @mattydebie I see you are also the maintainer of bitwarden-rofi and bitwarden-rofi-git AUR packages.
Could you please update them? The last update is on 2019. Thanks.
Currently, a user expects autotyping to work after installing xdotool, depending on their keymap, that may not be the case.
One example would be the @ showing up as a 2 on a swiss layout.
To make it work I run setxkbmap ch
on startup, by adding it to my .xprofile.
For some reason setxkbmap -query
includes the current layout already, so the following line works to set it:
setxkbmap $(setxkbmap -query | grep layout: | sed 's/layout: //g')
Though I would like for other people to test it before actually adding it to the script.
Alternatively the Heading "Autotyping" in the README.md should include a hint to using setxkbmap.
ydotool is a replacement for xdotool that works in Wayland. If it is detected, it could replace xdotool to type username and password for Wayland users.
Note that it requires root permissions to run, so it should be called with sudo and the user should allow this in visudo (ex: user ALL=(ALL) NOPASSWD: /usr/bin/ydotool
).
Thanks!
I have follow focus_follows_mouse yes
in my i3 config file. So when I launch the bwmenu rofi window and copy the password. The window that will be focused is where my mouse cursor happens to be. Even though I might have previously navigated windows using keybinds. This is a bit annoying as I often have to re-navigate to the window I had active when launching the bwmenu. What should I add to the bwmenu script so that it will focus the last active window and not the window where the mouse cursos is currently placed?
Rofi changed its command-line options. "-l" is used instead of "-lines".
The affect of this is the window to enter your Master Password is large instead of one-line.
I submitted a pull-request: #71
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.