#!/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|')"
purple-url-handler "$url" 2>&1 > /tmp/error_msg-$USER
if [[ -s "/tmp/error_msg-$USER" ]]; then
zenity --warning --no-wrap --text "$(cat /tmp/error_msg-$USER)"
fi
rm -f /tmp/error_msg-$USER
