Last active
December 20, 2023 21:32
-
-
Save igemnace/2b8609d280752e8a1b173204c14f6892 to your computer and use it in GitHub Desktop.
Rofi script to find a password from password-store and copy it to clipboard.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
cd "$HOME/.password-store" || exit 1 | |
pass_name=$(fd --type file --exec echo '{.}' | rofi -dmenu -i -p "pass") | |
[[ -n $pass_name ]] || exit 1 | |
if pass show -c "$pass_name"; then | |
notify-send --urgency=normal "$pass_name" "Password copied to clipboard!" | |
fi |
Ah! Pleasant surprise to see someone else using this. The first version had bad shell practices -- I've updated it to the current version I use. Hopefully less bad bash to go around on the web.
Uses https://github.com/sharkdp/fd (and notify-send from libnotify) but doesn't necessarily need it -- feel free to replace with find
. But fd is nice -- let this be a shout-out to the lucky 10 thousand.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sorting the passwords alphabetically would be nice.
pass_name=$(cd $HOME/.password-store && rg --files | sort |sed 's/\.gpg$//' | rofi -dmenu -i -p "pass:")
BTW thanks for this amazing scripts :)