Last active
June 3, 2019 16:02
-
-
Save mfaerevaag/ebebb9f1291d6b0975083647c23b8903 to your computer and use it in GitHub Desktop.
dmenu script for Lastpass
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
#!/bin/sh | |
# login | |
if not lpass status; then | |
lpass login [email protected] || exit | |
fi | |
# get alternatives | |
passwords=$(lpass ls | grep -v '.*\/\s' | grep -v 'Generated' | awk '{print $1;}') | |
# get choice | |
choice=$(printf '%s\n' "${passwords}" | dmenu "$@") | |
# exit if no choice | |
[[ -n $choice ]] || exit | |
# get password | |
lpass show -c --password $choice |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment