Skip to content

Instantly share code, notes, and snippets.

@mfaerevaag
Last active June 3, 2019 16:02
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mfaerevaag/ebebb9f1291d6b0975083647c23b8903 to your computer and use it in GitHub Desktop.
Save mfaerevaag/ebebb9f1291d6b0975083647c23b8903 to your computer and use it in GitHub Desktop.
dmenu script for Lastpass
#!/bin/sh
# login
if not lpass status; then
lpass login m@frv.ag || 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