aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xssh-agent-loadkey14
1 files changed, 13 insertions, 1 deletions
diff --git a/ssh-agent-loadkey b/ssh-agent-loadkey
index a335561..355a1e4 100755
--- a/ssh-agent-loadkey
+++ b/ssh-agent-loadkey
@@ -39,8 +39,13 @@ function __loaded {
#ssh-add -L | cut -d ' ' -f 3 | sed -e 's/^/\t/'
ssh-add -L | while read line; do
- handle="$(basename `echo $line | cut -d ' ' -f 3`)"
type="`echo $line | cut -d ' ' -f 1 | sed -e 's/^ssh-//'`"
+ handle="`echo $line | cut -d ' ' -f 3-`"
+
+ if [ -e "$handle" ]; then
+ handle="`basename $handle`"
+ fi
+
echo "$handle ($type)"
done | column -t -c 6
}
@@ -83,6 +88,13 @@ function __load {
else
ssh-add $KEY
fi
+
+ # UX
+ if [ "$?" == "0" ]; then
+ if which awesome-client &> /dev/null; then
+ echo "naughty.notify({title = \"SSH:\", text =\"Loaded $HANDLE ($TYPE)\", timeout = 2})" | awesome-client
+ fi
+ fi
}
# Dispatch