mattydebie / bitwarden-rofi

Wrapper for Bitwarden https://github.com/bitwarden/cli and Rofi
GNU General Public License v3.0
346 stars 56 forks source link

Copy TOTP code to clipboard when using auto_type all #54

Closed ickerwx closed 4 years ago

ickerwx commented 4 years ago

I found it a little annoying that I had to use bwmenu twice to use autotype and then copy the TOTP code. The Bitwarden browser plugin automatically copies the code into the clipboard after autotyping. I think this is quite useful, so here's another pull request that does that.

I had to add STDERR redirection to /dev/null because bw was returning an error message when no TOTP code exists, and this error message made a small rofi window appear after autotyping w/o TOTP. The redirection makes the stray window disappear.

Btw., this small modification really made me appreciate how well you implemented the features, it's all very modular and easy to understand :+1: Going into the code I did not expect this to be a one line change.

ickerwx commented 4 years ago

I don't understand why, but yesterday the redirection of stderr made the empty rofi window in case of an error go away, buy today I got it again. Maybe I'm going blind or something :D I'll see if I can think of a solution that works unintrusively while also keeping your error handling code intact, but this PR doesn't work as well as I'd like, after all.