From: Silvio Rhatto Date: Tue, 26 Mar 2019 01:23:00 +0000 (-0300) Subject: UX X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=71cc43a9bde4c63d8fb17e4f8126e16ba2f2f9fa;p=utils-ssh.git UX --- 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