widget:show() takes on optional colors parameter
[wmiirc-lua.git] / plugins / dstat_load.lua
blobd97f1cc3469b320addaf4a181192606dfffcf0a2
1 --
2 -- Copyright (c) 2007, Bart Trojanowski <bart@jukie.net>
3 --
4 -- Simple load applet for wmii bar.
5 --
6 -- NOTE: dstat is required.
7 --
8 local wmii = require("wmii")
9 local os = require("os")
10 local type = type
12 module("dstat_load")
14 widget = wmii.widget:new ("800_dstat_load")
15 wmii.add_exec ("TERM=vt100 dstat --load --nocolor --noheaders --noupdate 1",
16 function (line)
17 if not (type(line) == "string") then
18 return
19 end
21 local line = line:gsub ("%W%W+", " ")
22 if line:len() > 3 then
23 widget:show (line)
24 end
25 end)