summaryrefslogtreecommitdiffstats
path: root/irssi_notify.sh
blob: d017c5e6e5630cfac33856bb2687e952a5561672 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash

#tail -f $HOME/.irssi/fnotify |
ssh mistral 'tail -f ~/.irssi/fnotify' |
	sed -ru "
		s/&/\&/g;
		s/</\&lt;/g;
		s/>/\&gt;/g;
		s%(#[a-zA-Z]+ )&lt;([^>]{0,10})&gt;%\1<b>\2</b> %g
		s%(https?://[^ ]+\.[a-zA-Z]{1,3})%<a href=\"\1\">\1</a>%g;
		s%([a-zA-Z0-9+_-]+@[^ ]+\.[a-zA-Z]{1,3})%<a href=\"mailto:\1\">\1</a>%g;" |
	while read heading message
	do
		ssh mistral 'echo "" > ~/.irssi/fnotify';
		notify-send -t 5000 -- "${heading}" "${message}";
	done