[linux] tail2notify - script interface between tail -f + grep and notify-send

This isn't exactly a question. Just thought I'd share something I just wrote and found useful.

For those of you on modern linux boxen: you may be aware that there's a lovely little tool called notify-send that you can use to send notifications to the desktop. Any experienced shell-scripter could readily imagine how you could use something like that to popup a notification when a log file changes...

Well, I made a BASH script that does just that, but makes it quick and painless; no typing of while loops required. It also can potentially do some helpful formatting of the output.

One example: If you run it with no arguments while logged into your desktop environment, it will try to use sudo (or some gui sudo app) to do a tail on /var/log/secure or /var/log/auth.log, watching for ssh login attempts (and successful logins). When it sees one, it sends a notification to your desktop.

Check it out. Read the --help. Let me know what you think. :slight_smile:
Pretty colorized view: tail2notify/tail2notify at master · ryran/tail2notify · GitHub

PS: It's heavily commented.