Last active
December 22, 2015 18:09
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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