Mod4-[a-z] will go to a view that starts with that letter
[wmiirc-lua.git] / plugins / dstat_load.lua
blob0c8d59640a68e273bf6a260fb92ac1d5e50a393e
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")
13 api_version=0.1
15 widget = wmii.widget:new ("800_dstat_load")
16 wmii.add_exec ("TERM=vt100 dstat --load --nocolor --noheaders --noupdate 1",
17 function (line)
18 if not (type(line) == "string") then
19 return
20 end
22 local line = line:gsub ("%W%W+", " ")
23 if line:len() > 3 then
24 widget:show (line)
25 end
26 end)