Skip to content

Instantly share code, notes, and snippets.

@Kilobyte22
Created November 8, 2016 12:32
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 Kilobyte22/549c5179fcca87b19efab0eb819038d0 to your computer and use it in GitHub Desktop.
Save Kilobyte22/549c5179fcca87b19efab0eb819038d0 to your computer and use it in GitHub Desktop.
#!/bin/bash
title=$(dmenu -p 'password title: ' < /dev/null)
if [[ "$title" != "" ]]; then
if [[ -f ~/.password-store/"$title".gpg ]]; then
ans=$(echo -e 'no\nyes' | dmenu -p 'answer: ' -mesg 'Password exists, do you want to overwrite?' -only-match)
if [[ "$ans" == yes ]]; then
pass generate -f -c "$title" 30 && \
notify-send "Password Store" "Password generated"
fi
else
pass generate -c "$title" 30 && \
notify-send "Password Store" "Password generated"
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment