#!/usr/bin/bash
#Thanks to Dan Fandrich for his suggestions
url="$(echo -n "$1"|sed -e 's|ircs:|irc:|;s|:[0-9]\{1,5\}||;s|irc:irc|irc://irc|')"
tempfile=$(mktemp) && {
  purple-url-handler "$url" 2>&1 > "$tempfile"
  if [[ -s "$tempfile" ]]; then
    zenity --warning --no-wrap --text "$(cat $tempfile)"
  fi
  rm -f "$tempfile"
}
