division by zero, if battery is full charged

If the battery state change from charging to full,
power_now is reseted to zero for a little time.
This cause division by zero, which was visible as a very big negative
number because of the behaviour of string.format.

Signed-off-by: Adrian C. (anrxc) <anrxc@sysphere.org>
thermal: change coretemp default, allow file as widget argument

Since Linux 3.0 most if not all people have temp1_input file missing,
so default to temp2_input. But also allow an optional third argument
to change to yet another file to avoid this kind of problem in the
future.
README: update thermal documentation

Thermal now accepts an optional third argument when warg is a table.
Next release, tag 2.0.4
pkg: update 'Arch S' substitution lines

It would appear pacman v4 now prints only one line before the package
list.
cpufreq: handle not existing frequency/governer

In some cases not all cpu informations will be provided.
(ex. in virtual machines)
Therefore default to "N/A".

Signed-off-by: Adrian C. (anrxc) <anrxc@sysphere.org>
cpufreq: rework new exception handlers

Now that we are so nice to provide default frequency values check if
frequency exists before calculating voltage, not to screw up *those*
default values.

Signed-off-by: Adrian C. (anrxc) <anrxc@sysphere.org>
cpufreq: skip redudant freq variable check
Ported vicious module to lua 5.2

Signed-off-by: Arvydas Sidorenko <asido4@gmail.com>
Signed-off-by: Adrian C. (anrxc) <anrxc@sysphere.org>
Ported vicious.widgets module to lua 5.2

Signed-off-by: Arvydas Sidorenko <asido4@gmail.com>
Signed-off-by: Adrian C. (anrxc) <anrxc@sysphere.org>
Ported vicious.contrib to lua 5.2

Signed-off-by: Arvydas Sidorenko <asido4@gmail.com>
Signed-off-by: Adrian C. (anrxc) <anrxc@sysphere.org>
Fixed io.lines() bug

In Lua 5.2 io.lines() has to be used to iterate until EOF, otherwise
the fd will not be closed and eventually tons of naughty messages
will start to pop up saying that no more fd can be opened.

Signed-off-by: Arvydas Sidorenko <asido4@gmail.com>
Signed-off-by: Adrian C. (anrxc) <anrxc@sysphere.org>
widgets: cleanup behind the last commit 363c03e
bat: metatable bugfix after lua52 port
README: update initialization instructions

With the Lua 5.2 port we change the way vicious is loaded as a module,
so that it remains backwards compatible with Lua 5.1 users. Also added
the author of the Lua 5.2 port to the contributors list.
contrib: initialization bugfix after lua52 port

The _NAME field was missing in the contrib table. Thanks to Jorg
Thalheim for reporting this.
os: change os.getenv init to allow standalone usage of os widget

Test case:
lua> foo = require("vicious.widgets.os")
lua> print(foo()[1])
     /usr/share/lua/5.1/vicious/widgets/os.lua:66: attempt to call
     field 'getenv' (a nil value)
contrib: document how to enable contributed widgets
uptime: metatable bugfix after lua52 port fixed by Jorg Thalheim
README: prefer vicious in global space

We want to expose suspend, activate and force functions to external
shell scripts not just the Lua prompt.