Naughty log watcher

Here's a log watcher implementation in pure Lua. It will show a naughty popup each time something changes in one of the predefined log files. The original code base on konius work and is refactored as a module and updated for newer version of awesome

1. Install luasocket and inotify

On debian $ apt-get install luarocks lua-socket On Arch $ pacman -S luarocks luasocket

Then just install inotify from luarocks (needs root for systemwide install) $ luarocks install inotify

2. Clone or download the code into your awesome configuration directory $ cd $XDG_CONFIG_HOME/awesome $ git clone https://github.com/Mic92/lognotify.git

3. Load the module in your configuration: local lognotify = require("lognotify")

4. Set some config variables (make sure the files are readable to you): ilog = lognotify{ logs = { mpd = { file = "/home/bob/.mpd/log", }, aptitude = { file = "/var/log/aptitude", }, -- Check, whether you have the permissions to read your log files! -- You can fix this by configure syslog deamon in many case. syslog   = { file = "/var/log/syslog", ignore = { "Changing fan level" }, },  	awesome  = { file = "/home/bob/log/awesome", ignore = { "/var/lib/dpkg", -- aptwidget failure when aptitude running "wicd", "wired profiles found", -- wicd junk "seek to:", "Close unzip stream", -- gmpc junk "^nolog"}, },  -- Delay between checking in seconds. Default: 1 interval = 1, -- Time in seconds after which popup expires. Set 0 for no timeout. Default: 0 naughty_timeout = 15 }

5. Run it: ilog:start

That's it.