Created
September 29, 2015 15:50
-
-
Save linktohack/b0d015b752fa23de3260 to your computer and use it in GitHub Desktop.
Another password manager
This file contains 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
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