Last active
March 10, 2016 13:12
-
-
Save mrbalihai/3480a62f1ef1947db1ce to your computer and use it in GitHub Desktop.
Copy passbox to clipboard
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
# Add the following to your .bashrc | |
# USAGE: pass "password entry name" | |
function pass() { | |
local PASS=$(passbox get ${1} | grep Password\: | cut -c 10-) | |
echo $PASS > /dev/clipboard # /dev/clipboard is for cygwin but this could be replaced with any clipboard command e.g: | |
# `echo $PASS | xclip -selection clipboard` # Linux with xclip | |
# `echo $PASS | pbcopy # OSX/Darwin | |
echo "" | |
echo "Copied password to clipboard for 15s" | |
sleep 15 | |
echo "" > /dev/clipboard # This also needs changing as on line 5 to reflect your desired clipboard e.g: | |
# `echo "" | xclip -selection clipboard` # Linux with xclip | |
# `echo "" | pbcopy # OSX/Darwin | |
echo "Clipboard cleared" | |
} | |
alias pass="pass" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment