Skip to content

Instantly share code, notes, and snippets.

@mharju
Created April 3, 2011 08:28
Show Gist options
  • Save mharju/900290 to your computer and use it in GitHub Desktop.
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
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
}
@mharju
Copy link
Author

mharju commented Feb 13, 2012

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment