Created
April 3, 2011 08:28
-
-
Save mharju/900290 to your computer and use it in GitHub Desktop.
A function to include in your .zshrc to copy passwords to OS X clipboard from Sala
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
SALADIR=~/.sala | |
function _sala_all { | |
(cd $SALADIR && find . | cut -d'/' -f 2,3 | grep '/' | grep -v '.git' | xargs) | |
} | |
function _salacomp { | |
reply=(`_sala_all`) | |
} | |
compctl -K _salacomp sc | |
function sc { | |
if [ "$1" != "" ]; then | |
sala -r $1 | osascript -e 'set the clipboard to do shell script "cat"' | |
else | |
echo "Usage $0 key-name" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A new and a lot faster version of the autocomplete (i really do not know why I did it that way...) Uses the new -r switch of sala that gives only the password so no need to strip anything