31. 8. 2008

irssi in screen, popup in gnome (or KDE)

I was looking for way how to be notified about new event in irssi running in screen on remote server. After few minutes I've found many howtos on webblogs. Here is the most simple one:

1.) Download script fnotify.pl to ~/.irssi/scripts/fnotify.pl and make symbolic link to .irssi/scripts/autorun (ln -s ~/.irssi/scripts/fnotify.pl ~/.irssi/scripts/autorun/fnotify.pl [to automatic start script after new irssi start])
- manually you can load this script in irssi by /load fnotify

this script will generate file ~/.irssi/fnotify with messages for you, or highlighted messages (command /hilight in irssi)

2. Now we need some local script which will check file ~/.irssi/fnotify on remote server and display popup message, something like this:

ssh username@host ": > .irssi/fnotify ; tail -f .irssi/fnotify " |
sed -u 's/[<@&]//g' | while read heading message; do /usr/bin/notify-send -u critical -i /usr/share/icons/gnome/scalable/apps/im-yahoo.svg -t 3000 -- "${heading}" "${message}"; done

You can also put this script in automatic started services (System -> Preferences -> Sessions)

Žiadne komentáre: