function alert --description 'Report status of command to desktop' set -l cmd $argv set -l cmd_str (string join ' ' $cmd) set -l output (eval $cmd 2>&1) set -l retval $status if functions -q notify if test $retval -eq 0 notify "✅ Done: $cmd_str" "$output" else notify "❌ Failed $cmd_str" "$output" end else if test $retval -eq 0 printf "✅ Done: %s\n%s\n" "$cmd_str" "$output" else printf "❌ Failed: %s\n%s\n" "$cmd_str" "$output" end end return $retval end