bin/wakey.sh: Include hostname in notification if SSH is implicated.
[profile] / bin / wakey.sh
index bab1cdf..208dfc8 100644 (file)
@@ -34,6 +34,8 @@ __wakey_precmd () {
            win=$(xprop -root _NET_ACTIVE_WINDOW | sed 's/^.*[#=] //')
            if [[ $win = *"not found." ]] || (( win == WINDOWID )); then
              suppress=t
+           elif (( win == 0 )); then
+             :
            else
              for i in $(xwininfo -tree -id $win 2>/dev/null |
                              sed -n '/^ *[0-9]\+ child\(ren\)\?[.:]$/,$ {
@@ -53,7 +55,9 @@ __wakey_precmd () {
            *) icon=dialog-warning head="Command FAILED (rc = $rc)" ;;
          esac
          cmd=${__wakey_cmd//&/&amp;}; cmd=${cmd//</&lt;}; cmd=${cmd//>/&gt;}
+         case ${SSH_CONNECTION+t} in t) head="[$HOST] $head" ;; esac
          notify-send -c Wakey -i $icon -t 5000 "$head" "$cmd"
+         ;;
       esac
       __wakey_start=nil
       ;;