Skip to content

Instantly share code, notes, and snippets.

@linktohack
Created September 29, 2015 15:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save linktohack/b0d015b752fa23de3260 to your computer and use it in GitHub Desktop.
Save linktohack/b0d015b752fa23de3260 to your computer and use it in GitHub Desktop.
Another password manager
function lastpass () {
url=""
username=""
password=""
function fill() {
pb=$(pbpaste)
osascript -e 'tell application "System Events" to keystroke tab using command down'
echo "$username" | pbcopy
osascript -e 'tell application "System Events" to keystroke "v" using command down'
osascript -e 'tell application "System Events" to keystroke tab'
echo "$password" | pbcopy
osascript -e 'tell application "System Events" to keystroke "v" using command down'
osascript -e 'tell application "System Events" to keystroke return'
echo "$pb" | pbcopy
}
function open-url() {
echo open "$url"
open "$url"
}
if record=$(gpg2 --batch -d ~/Desktop/lastpass.csv.gpg 2>/dev/null | csvfilter -f0,1,2,4,5 | fzf); then
url=$(echo "$record" | csvfilter -f0)
username=$(echo "$record" | csvfilter -f1)
password=$(echo "$record" | csvfilter -f2)
fi
if [ ! -z "$record" ]; then
open-url
# fill
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment