aboutsummaryrefslogtreecommitdiff
path: root/ssh-agent-loadkey
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2019-03-25 22:23:00 -0300
committerSilvio Rhatto <rhatto@riseup.net>2019-03-25 22:23:00 -0300
commit71cc43a9bde4c63d8fb17e4f8126e16ba2f2f9fa (patch)
tree15df8d48d5a4902b2f43b6ed7840f79b1835b5a0 /ssh-agent-loadkey
parent35c0b6f8b71a5ce85c00e81b46820aa96568b102 (diff)
downloadutils-ssh-71cc43a9bde4c63d8fb17e4f8126e16ba2f2f9fa.tar.gz
utils-ssh-71cc43a9bde4c63d8fb17e4f8126e16ba2f2f9fa.tar.bz2
UX
Diffstat (limited to 'ssh-agent-loadkey')
-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