Skip to content

Instantly share code, notes, and snippets.

@coderofsalvation
Last active December 22, 2015 18:09
Show Gist options
  • Select an option

  • Save coderofsalvation/6510593 to your computer and use it in GitHub Desktop.

Select an option

Save coderofsalvation/6510593 to your computer and use it in GitHub Desktop.
generates notifications on your desktop (ubuntu/Gnu Linux X environment) when something happens in a channel on irssi (on another server) using ssh.
#!/bin/bash
#
# will show local notifications when something happens on IRC (using irssi)
#
# Usage:
#
# 1) make sure you have passwordless access to the server where irsii is running
# (hint: ssh-keygen & ssh-copy-id)
# 2) type in irssi: /set autolog on
# 3) look in ~/irclogs which channel you want to log (on the server running irssi)
# 4) run this script upon boot e.g.:
# - in /etc/rc.local using 'nohup ./notify-irssi'
# - put this in your crontab: * * * * * ps aux| grep notify-irc-irssi | grep -v grep || nohup /home/sqz/bin/notify-irc-irssi &
IRSSISERVER="[email protected]"
LOGFILE="/home/you/irclogs/FOO/#foo.log"
IGNORELINES='(\[timelog\]|somekeyword|<@you>)'
ssh $IRSSISERVER tail -f $LOGFILE | while read msg; do
echo "$msg" | grep -vE $IGNORELINES &>/dev/null &&
DISPLAY=:0.0 notify-send -t 2000 -a irc "$msg" &
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment