fdw / rofi-rbw Goto Github PK
View Code? Open in Web Editor NEWRofi frontend for Bitwarden
Home Page: https://github.com/fdw/rofi-rbw/
License: MIT License
Rofi frontend for Bitwarden
Home Page: https://github.com/fdw/rofi-rbw/
License: MIT License
when i try to start rofi-rbw from the cli i get the following error:
rofi -modi "rofi-rbw:rofi-rbw" -show rofi-rbw
Traceback (most recent call last):
File "/usr/bin/rofi-rbw", line 8, in <module>
sys.exit(main())
File "/usr/lib/python3.10/site-packages/rofi_rbw/rofi_rbw.py", line 231, in main
RofiRbw().main()
File "/usr/lib/python3.10/site-packages/rofi_rbw/rofi_rbw.py", line 132, in main
parsed_entries = [Entry.parse_rbw_output(it) for it in entries]
File "/usr/lib/python3.10/site-packages/rofi_rbw/rofi_rbw.py", line 132, in <listcomp>
parsed_entries = [Entry.parse_rbw_output(it) for it in entries]
File "/usr/lib/python3.10/site-packages/rofi_rbw/entry.py", line 33, in parse_rbw_output
fields[1],
IndexError: list index out of range
Not sure what is wrong. maybe i miss a package or something?
Hi, was just wondering if @fdw or anyone else has had a chance to test dotool support out? It's been in for awhile so was wondering if we could get a release.
A yaml config would be more convenient. It's pretty easy to implement with https://github.com/omni-us/jsonargparse/
Currently all entries are serialized into a single string and passed to rofi
for selection.
In Rofi's dmenu specs it is mentioned that it's possible to add a -format i
argument, which results into the row number being printed instead of the full line.
This could be used to find the user's selected entry by parsing that number as an int and using it as an index in the entry list. This removes the entire need to splitting the selected entry line to remove the formatting.
I do want to note that I don't know if this is supported by the other selectors.
What do you think?
I'm on plasma 6 using wayland (Tuxedo OS 3). Rofi-rbw works perfectly fine when launched from terminal, but it wont open from krunner, shortcut or else.
I've tried using rofi, wofi and the rofi-wayland fork, also using ydotool and dotool and no dice.
FWIW rofi-wayland does run with no problem when called from inside terminal, and rofi-rbw still runs fine on x11 as well.
It would be awesome if we could add an action to just stdout the username and password. This would allow easy integration in qutebrowser and other software.
Hello, really like the program so far.
One thing though. Can I change the rofi theme somehow?
In other applications I can f.e. put the command to run to something like "rofi -theme theme.rasi"
Every time I restart the system I need to enter the master password, which is a lot since it has 30 digits.
I installed your package using pip and when I run rofi-rbw in terminal I get the following:
Could not find a valid way to type characters. Please check the required dependencies.
I have a minimal install of nixos so I think I have some lacking dependencies, but I'm not sure what they are.
I still see the issue where you cannot copy/type data from a custom field named 'password', even though it is visible.
Steps to reproduce:
password
Result: empty clipboard
Expected: custom data in clipcoard
Originally posted by @mindrunner in #74 (comment)
I have rofi-rbw 1.0.0 installed from Void and when I try to use it with wofi, it does not type (wtype), print to stdout, or copy (wl-copy). However, when I use rofi, it does work.
I've already confirmed that removing all of my user configuration for wofi does not chance anything.
I found this project today and was really happy about it, but there is one bug that annoys me a lot and that is something that I think has been mentioned here and here.
When I've used the autotype feature my alt-key is messed up. It's like my alt-key is pressed down. To solve this I have to press alt one time and then everything becomes normal again.
The other issue said it might be some kind of weird character that is messing things up, but that is not the case for me. I have to autotype the password (it's not breaking if i just autotype username) for it to break, and it is breaking without any weird characters. It breaks with only numbers and/or the alphabet as well.
I don't know if this issue is a bug of rofi-rbw or xdotool, but since the other issues was kind of old and closed without a fix, I figured i should create another one.
Hi,
coming from pass I am spoiled with the options you can do in auto type mode. When e.g. using git from the command line I often need to enter username and password to two consecutive prompts. So it would be really nice instead of needing to invoke rofi-rbw twice to first enter username wait for some short time and then enter the password.
Thanks,
Matthias
When I autotype passwords that includes characters that aren't normal letters or numbers, the keyboard layout gets scuffed beyond repair until manual reboot. I don't know of any corralation between the characters typed and the change being changed, but most of the alphabetical keys are rendered non-functional and some are mixed and matched, including the meta key, ESC, etc.
I'm using a bspwm+sxhkd setup on Arch Linux, and some of the passwords were imported from KeePass which uses way more character types than Bitwarden's password generator. That may have something to do with it.
Using rofi
, I can chose via keybinds what to copy (user, pass, otp, type, etc...). Is there an equivalent for wofi
?
I think wofi
lacks this feature sort of, right? I am currently using a combination of the official bitwarden
cli
and bash script for this. after selecting an entry, I can select what to copy. Would nice to see something like that in rofi-rbw
as well. Or am I missing something?
Hi,
When xdotool type my password, the 2 first characters get uppercased, maybe ~75% of the time.
Fidling with XDoToolTyper
, I noticed that removing the --delay 0
arguments seems to prevent this:
rofi-rbw/src/rofi_rbw/typer.py
Lines 54 to 55 in 05e1d4d
Hi, today I downloaded rofi-rbw, and had some problems getting it to work. The issue is resolved for my case now, but maybe it can lead to a bug fix in the code for the future. Or information for someone that has a similar problem.
I was getting this error:
Traceback (most recent call last):
File "/usr/bin/rofi-rbw", line 8, in <module>
sys.exit(main())
File "/usr/lib/python3.10/site-packages/rofi_rbw/rofi_rbw.py", line 231, in main
RofiRbw().main()
File "/usr/lib/python3.10/site-packages/rofi_rbw/rofi_rbw.py", line 132, in main
parsed_entries = [Entry.parse_rbw_output(it) for it in entries]
File "/usr/lib/python3.10/site-packages/rofi_rbw/rofi_rbw.py", line 132, in <listcomp>
parsed_entries = [Entry.parse_rbw_output(it) for it in entries]
File "/usr/lib/python3.10/site-packages/rofi_rbw/entry.py", line 33, in parse_rbw_output
fields[1],
IndexError: list index out of range
I inspected the output of rbw ls --fields 'folder,name,user'
as per this issue #38. And found that the output had some empty lines.
I do not know how, but for some reason I had an item in my bitwarden vault that had a newline in the user field. This was not intended, so I fixed this entry.
I could not replicate the entry in bitwarden. It is not possible to insert newlines on the user field.
But I think this might be an edge case to consider.
Hi !
I switch from bitwarden-pyro to rofi-rbw as pyro seems not maintained anymore.
Pyro can use rofi to request the vault password, this choice allows for a more integrated design as the window to display the credentials and the window to asks for the password are the same.
I was wondering if rofi-rbw could offer the same possibility ?
I did the modification for pyro here mihalea/bitwarden-pyro#7 (it was never merged unfortunately).
I can make the modifications to rofi-rbw if you are ok
When I call this program, it uses pinentry-gtk2
even when my session is Wayland. This means the pinentry has no DPI scaling (and just general Xwayland issues). Is there a way to tell rofi-rbw to use a different pinentry, such as pinentry-gnome3
?
I think that changes to ydotool break rofi-rbw
, with the error:
ydotool: Unknown command: sleep
Run 'ydotool help' if you want a command list
Edit:
Actually, that error doesn't appear any more after I update my sudoers
file with:
your_username ALL=(ALL) NOPASSWD: /usr/bin/ydotool
The bitwarden-rofi
docs have:
Wayland Users: For autotyping to work in Wayland, you will need ydotool working with root permissions (it needs access to /dev/uinput) without asking for password. For example, this can be achieved by adding this line in visudo:
However, some other things I've noticed:
rofi-rbw
with sway
doesn't work at all (nothing happens)The current keybinding conflicts with my WM config.
It would be nice if you add an option to change the keybindings.
Thanks ;)
a front-end to run rbw sync
Hi, is there currently a way to clear clipboard content after a certain time? Looking around I haven’t found a proper option, neither in xclip/xsel
nor in rofi-rbw
itself.
I might have stumbled upon another problem: I set my specific rofi theme via the --selector-args '-theme /home/das-s/.config/rofi/appmenu.rasi'
. Then, using the new action menu it appears to reset the theme when entering the selector menu. A possible cause might be here.
Is there a reason to pass an empty list to the additional_args
parameter or is this just an oversight?
I wanted to send the output from rofi-rbw to a window to display a password and keep the copy actions, however rofi-rbw hangs in this case.
PASSWORD=$(rofi-rbw)
echo "$PASSWORD" # this won't execute if you exit rofi with Alt+c
If instead you exit with Enter, the output is properly displayed.
I would have expected to just display an empty string.
Looks like rofi-rbw
trips on the final \n
character at the end of the password text from rbw
:
Traceback (most recent call last):
File "/home/cstrahan/.local/bin/rofi-rbw", line 8, in <module>
sys.exit(main())
File "/home/cstrahan/.local/lib/python3.8/site-packages/rofi_rbw/rofi_rbw.py", line 187, in main
RofiRbw().main()
File "/home/cstrahan/.local/lib/python3.8/site-packages/rofi_rbw/rofi_rbw.py", line 134, in main
data = self.get_credentials(selected_entry.strip(), selected_folder.strip())
File "/home/cstrahan/.local/lib/python3.8/site-packages/rofi_rbw/rofi_rbw.py", line 183, in get_credentials
return Credentials(result)
File "/home/cstrahan/.local/lib/python3.8/site-packages/rofi_rbw/credentials.py", line 13, in __init__
key, value = line.rsplit(": ", 1)
ValueError: not enough values to unpack (expected 2, got 1)
When I type Alt+T I just type t instead of copying the TOTP
In rofi-rbw
version 1.4.1 but I guess also in 1.4.0, when running rofi-rbw -t password -a type --typer wtype --selector-args="--insensitive"
, selecting an option, then there is nothing typed but it logs
rofi-rbw
Invalid sleep time
Invalid sleep time
I think the problem was added with the new --typing-key-delay
option in
rofi-rbw/src/rofi_rbw/argument_parsing.py
Line 112 in 270437e
and is quiet the same as in #57, wtype -d 0 'Hello World'
is not allowed.
My current workaroud is to add --typing-key-delay 1
to the command above.
Steps to reproduce
rbw add Test # write 123456 as password
rofi-rbw --no-help
Select "Test" entry and press Alt+3
. The password is printed as 12456
.
If the password is printed using Return
through rofi-rbw --no-help -t password
then everything works!
System
NixOS (unstable)
rofi-rbw 1.1.0
DE xmonad
Typer xdotool
This was sooo tricky to notice haha -- I hope this report helps in finding the fix!
Hi,
With wofi, the first entries shown are the one most used, which is super convenient. But with rofi, this is not possible, as we are using dmenu mode, and this won't be implemented there: davatorium/rofi#747.
Therefore, I suggest to implement this in rofi-rbw, and maintain a simple history file in cache, as what rofi is already using, eg:
$ cat ~/.cache/rofi-3.runcache
18 thunderbird
17 firefox
3 pavucontrol
For my current use cases, I guess {n} {entry.folder}/{entry.name}\n
would be enough, and I can provide a PR for this.
But if anybody has better ideas before that, please don't hesitate !
Hello!
Thank you for the awesome tool! I've been having a particular issue launching it from i3, and I'm curious if there's anything on the internals of rofi-rbw that could be causing this.
It's probably unlikely that the initial run of rofi-rbw (which sends to unlock rbw) would work through a keybind, but I'm not sure why it wouldn't work to just exec rofi-rbw
from an i3 keybind.
Just hoping to get your insight.
Thanks!
Currently the TOTP code generation is done through a python library, however I just noticed that it's also possible to obtain through rbw code [entry]
, do you think it would be better to use that rather than the python dependency? I feel like a dependency less is a good thing and I'm willing to throw a PR if you agree.
Line 15 in 3736739
With the resent pull request, Wtype doesn't work with the default typing-key-delay of 0. Here is the output with the default arguments.
[<rofi_rbw.models.Target object at 0x7f8ecda4d1d0>, <rofi_rbw.models.TypeTarget object at 0x7f8ecdac9750>, <rofi_rbw.models.Target object at 0x7f8ecda55810>]
Invalid sleep time
Invalid sleep time
I guess somewhere in the new code the sleep time is wrong? Currently I need to manually set this arg to 1 to fix.
I've come across a situation were grabbing the TOTP is not working. In said situation there are two items with the same name but different usernames.
The result with this setup is an empty string in the clipboard. So checking how rofi-rbw is grabbing the TOTP I get this on the commandline:
[lem@host rofi_rbw]$ rbw code sandwich --folder server/hetzner
rbw code: couldn't find entry for 'sandwich': multiple entries found: root@sandwich, luks@sandwich
Would it be possible to add the functionality that rofi-rbw adds the username to the TOTP-command if there are multiple items?
In PR #52, a default type delay of 0ms
is added for all typers. As mentioned in that PR wtype
already uses a default delay of 0ms
.
However I just noticed that using -d 0
with wtype results in an error, i.e.:
% wtype -d 0 'Hello World'
Invalid sleep time
Meaning that using wtype
does not allow you to type in the current state. I think the easiest solution is to remove the delay 0 argument, as it's also the default. Alternativly, adding typer arguments as discussed in PR #52 would also solve this issue, what do you think?
Is there any chance of custom field support at all? When hitting enter on a selected item, it could bring up a menu with all of its fields. Hitting enter again on a selected field could autotype its value.
Having trouble with auto typing user/pass -- the current approach isn't working in Chrome, gedit, Gnome Terminal, etc (the applications appear to ignore the sent keys entirely).
Per the "SENDEVENT NOTES" section of the xdotool
man page (http://manpages.ubuntu.com/manpages/trusty/man1/xdotool.1.html#sendevent%20notes):
If you are trying to send key input to a specific window, and it does not appear to be
working, then it's likely your application is ignoring the events xdotool is generating.
This is fairly common.
Sending keystrokes to a specific window uses a different API than simply typing to the
active window. If you specify 'xdotool type --window 12345 hello' xdotool will generate
key events and send them directly to window 12345. However, X11 servers will set a
special flag on all events generated in this way (see XEvent.xany.send_event in X11's
manual). Many programs observe this flag and reject these events.
It is important to note that for key and mouse events, we only use XSendEvent when a
specific window is targeted. Otherwise, we use XTEST.
Some programs can be configured to accept events even if they are generated by xdotool.
Seek the documentation of your application for help.
Specific application notes (from the author's testing): * Firefox 3 seems to ignore all
input when it does not have focus. * xterm can be configured while running with
ctrl+leftclick, 'Allow SendEvents' * gnome-terminal appears to accept generated input by
default.
Tried changing the type_characters
function to this, and looks like things are now working:
def type_characters(self, characters: str, active_window: str) -> None:
run([
'xdotool',
'windowactivate',
'--sync',
active_window,
'type',
'--clearmodifiers',
characters
])
The idea being to explicitly activate the previous window and then send the chars.
cstrahan@pop-os:~/src/xsel$ cat /etc/os-release
NAME="Pop!_OS"
VERSION="20.04 LTS"
ID=pop
ID_LIKE="ubuntu debian"
PRETTY_NAME="Pop!_OS 20.04 LTS"
VERSION_ID="20.04"
HOME_URL="https://pop.system76.com"
SUPPORT_URL="https://support.system76.com"
BUG_REPORT_URL="https://github.com/pop-os/pop/issues"
PRIVACY_POLICY_URL="https://system76.com/privacy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
LOGO=distributor-logo-pop-os
rofi-rbw is showing up no items and it is asking for bitwarden password every time.
None of the keybinds in the readme work for me besides <enter>
.
The prompt blanks out when the keybinding is pressed but nothing happens until enter is pressed. No matter which default keybind I press, the username and password are always printed after after pressing enter.
Tried rofi-rbw --keybindings ctrl+n:copy:username
with no success with the new ctrl+n
keybinding.
Built using python -m build . --wheel
and installed with pip.
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.