Skip to content

Instantly share code, notes, and snippets.

@trq
Created May 1, 2014 03:21
Show Gist options
  • Save trq/e8c135faf2acd356a1b6 to your computer and use it in GitHub Desktop.
Save trq/e8c135faf2acd356a1b6 to your computer and use it in GitHub Desktop.
irssi_notifier() {
ssh freaks 'echo -n "" > ~/.irssi/fnotify; tail -f ~/.irssi/fnotify' | \
while read heading message; do
url=`echo \"$message\" | grep -Eo 'https?://[^ >]+' | head -1`;
if [ ! "$url" ]; then
terminal-notifier -title "\"$heading\"" -message "\"$message\""
else
terminal-notifier -title "\"$heading\"" -message "\"$message\"" -open "\"$url\"";
fi;
done
}
irssi_notifier &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment