- Place the
ssh-config
file in~/.ssh/config
- Place the
irc-notify.sh
file in~/bin/irc_notify.sh
- Place the
fnotify.pl
file on the remote server within~/.irssi/scripts
- Link the
fnotify.pl
script to~/.irssi/scripts/autorun/fnotify.pl
- Install
terminal-notifier
(link?) - SSH into the remote box:
ssh personal -i .ssh/personal.pem
(or whatever your keyfile is named). - From there, run a
tmux
session and then runirssi
.
When you login to the remote box (where you'll be running irssi
), the SSH config will tell SSH to first run the irc-notify.sh
script, which will clear the fnotify
file and, in effect, pipe the tail of the fnotify
file to your local terminal-notifier
program. (It will first kill any such commands that are already running.)
When you start up irssi
on the remote server, it will, in turn, run the fnotify.pl
script, which will check for highlighted messages in IRC (i.e. referencing your nick, or whatever you have set up for highlighting), and then write those lines to the fnotify
file.
Since you now have a process piping that file to terminal-notifier
on your local box, you'll get notifications any time a message is highlighted. If the pipe dies for some reason (typically, I suppose, because the SSH session that's tailing the fnotify
file dies), you'll have to SSH in again, but you don't usually need to start another irssi
session.
https://github.com/alloy/terminal-notifier
or
gem install terminal-notifier