Skip to content

Passrofi a rofi/dmenu script to autofill OTP for pass-otp > It Suckless

License

Notifications You must be signed in to change notification settings

FlareXes/passrofi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Passrofi

Rofi/dmenu to autofill TOTP for pass-otp. A better, faster and suckless way to autofill otps.

XOrg / Wayland Compatible

Before using this script make sure you're using pass-otp. A pass extension for managing one-time-password (OTP) tokens.

Check this blog post for info and explaination of this script How to Setup and Autofill OTP Using Pass-OTP?

Note: Passrofi default uses rofi. You can can also use dmenu by uncommenting 31th line and comment 27th line.

Prerequisite

For XOrg

- Rofi / Dmenu
- xclip
- xdotool

For Wayland

- Rofi / Dmenu
- wl-copy
- wtype

Installation

wget https://raw.githubusercontent.com/FlareXes/passrofi/main/passrofi -O /usr/local/bin/passrofi

sudo chmod +x /usr/local/bin/passrofi

Keyboard Bindings

It's best to bind passrofi with Keyboard shortcut. I use sxhkdrc but you're free to use any.

# Pass-Otp
alt + shift + l
  /usr/local/bin/passrofi

Resources

How to update GPG keys?

Encrypting your OTPs with new GPG keys is a crucial security practice. To simplify this process, I've created a bash script, passrofi-update-keys.sh. This script automates the key update, ensuring that your OTPs remain secure. Additionally, it keeps a backup of your previous keys for added safety. Existing ~/.password-store and ~/.gnupg will be backed up as ~/.password-store-bak, ~/.gnupg-bak respectively.

  1. Run bash passrofi-update-keys.sh
  2. This will decrypt and export all TOTPs' URIs into a file named passwords.csv.
  3. Then, Choose to either create new keys (recommended) or select existing ones.
  4. From here, Script will handle the update automatically. If any errors occur, script will stop, allowing you to debug.
  5. Important: Don't forget to delete passwords.csv once the update is complete. The script won't do it for you.*

Note: I recommend updating GPG keys once or twice a year.

I hope this might have saved you some time and hustle.

LICENSE

MIT License

Copyright (c) 2022 FlareXes

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.