An excerpt from my rc.lua
         local acpitool = io.popen('acpi')
         for line in acpitool:lines() do
            start = line:find('%d+%%')
            ende  = line:find('%%')
            remain_textbox = line:sub(start, ende)
            remain = line:sub(start, ende-1)
            start = line:find(':')
            line2 = line:sub(start+2, line:len())
            if tonumber(remain) > 66 then
                  color = 'green'
               elseif tonumber(remain) > 33 then
                  color = 'yellow'
               else
                  color = 'red'
               end
            mytextbox2.text =  "<span color='" .. color .. "'> " .. line2 ..
" </span>"
         end
         acpitool:close()


yeah, the idea is absolutely stol^H^H^H^Hborrowed from someone else's
config, sorry but I can't remember where I saw it....



-- 
Saludos,
                        Germán

Delivering common sense since 1969 <Epoch Fail!>.

The Nature is not amiable; It treats impartially to all the things. The wise
person is not amiable; He treats all people impartially.

<<attachment: batt.jpg>>

Reply via email to