]> gitweb.fluxo.info Git - utils-ssh.git/commitdiff
UX
authorSilvio Rhatto <rhatto@riseup.net>
Tue, 26 Mar 2019 01:23:00 +0000 (22:23 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Tue, 26 Mar 2019 01:23:00 +0000 (22:23 -0300)
ssh-agent-loadkey

index a3355610ecdd9c7ce096447939e5a475357fa9ac..355a1e4ebdfbbe822b7cc84d1db34e8ed38f8d03 100755 (executable)
@@ -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