Commit Graph

16 Commits

Author SHA1 Message Date
Adrian C. (anrxc) 0d73f6d8ae Ensure returned numbers are of type number
Thanks to Felix for bringing this to my attention. Obviously there was
already a safety net for feeding progressbars and graphs... and while
this makes for a good coding practice it's not a big deal. We have
widgets of type textbox for one, and a lot of string concatenation
happens. Strings are formatted, markup is applied...
2009-10-26 20:32:48 +01:00
Adrian C. (anrxc) 97d2ecbb19 bat: better returns when handling insufficient data
If we return "N/A" like we usually do then format string "$1$2" would
look like "N/AN/A". If "/" is returned a progressbar could be
broken. Now returns are: symbol for state "unknown", 0 for battery
charge, N/A for remaining time.
2009-10-15 23:38:55 +02:00
Adrian C. (anrxc) 4d1af1e5ad bat: better fix for ACPI, from bioe007
Previous commit had redudant string > number conversions, and only
covered one scenario - when battery is charged. bioe007 suggested to
use math.min. Now lets explain why this is needed. Some (lousy)
batteries report "remaining capacity" higher than "last full capacity"
when AC is connected. That leads to battery charges like "160%".
2009-10-15 23:11:36 +02:00
Adrian C. (anrxc) 2cfdd5aac7 bat: quick fix for broken BAT/ACPI implementations 2009-10-15 21:36:24 +02:00
Adrian C. (anrxc) af4e85f99d bat: added a handler for incompetent users
A lot of people expect widgets like this one to auto-magically work,
and somehow don't understand that *they* need to make sure there is a
source of information. Is ACPI module loaded? Is battery info exposed
in the same place that widget expects by default? You need to answer
those questions before loading the widget and sending me "bug"
reports.
2009-10-04 16:26:34 +02:00
Adrian C. (anrxc) b4e028b21f Removed some useless else statements 2009-10-04 00:54:27 +02:00
Adrian C. (anrxc) 0e863a5249 bat: coding style changes 2009-10-02 20:33:58 +02:00
Adrian C. (anrxc) b0f737ea56 Rewrote all headers 2009-09-29 22:33:19 +02:00
Adrian C. (anrxc) 2a5126f4f0 General cleanup 2009-09-14 17:25:23 +02:00
Adrian C. (anrxc) d4595bb00f All worker functions are local. 2009-08-07 17:41:10 +02:00
Adrian C. (anrxc) 418151f57e Make all widgets return their worker functions when called. 2009-08-01 23:11:41 +02:00
Adrian C. (anrxc) 1b9906165d Use utf symbols for some bat states. Mention LuaFileSystem in mdir.lua 2009-07-31 20:40:36 +02:00
Adrian C. (anrxc) bc637062d7 Coding style fixes in battery widgets. 2009-07-30 20:47:02 +02:00
Adrian C. (anrxc) e2d503ee36 Added a new, standalone, battery widget.
The widget reads /proc/acpi/battery/*/{info,state} and doesn't require
an external utility like 'acpi' or 'acpitool'. It returns state,
charge and remaining time information, just like the old bat (now
batat) widget. Using /sys/class/power_supply we would need to open
much more file descriptors so we use /proc for now.
2009-07-30 01:48:07 +02:00
Adrian C. (anrxc) 76b8978ef2 Battery widget moved to batat.lua in preparation for a new bat widget.
It's time for a standalone battery widget that reads
/proc/acpi/battery/*/{info,state} alone. However the old battery
widget that uses 'acpitool' will not be deleted, let it serve as an
alternative widget as a convenience. Some might also prefer it over
reading multiple files in /proc
2009-07-29 22:20:32 +02:00
Adrian C. (anrxc) 98e26ee043 Import of vicious source tree.
Vicious is a modular widget library for 'awesome' window manager,
derived from the 'Wicked' widget library.

Summary of changes:
  * Original wicked code modularized
  * Widgets ported from Wicked:
    - CPU, MEM, FS, NET, Date, Uptime, MPD
      * CPU widget rewritten, uses pattern matching
      * MEM widget rewritten, uses pattern matching
        - Swap widget merged with MEM widget type
      * FS widget rewritten, uses pattern matching
        - Also fixed padding in the process
      * NET widget rewritten, uses pattern matching
      * MPD widget rewritten, a bit more versatile
      * Removed deprecated helper functions
  * Widgets written for Vicious:
    - Thermal, Battery, Mbox, OrgMode, Volume, Entropy,
      Disk I/O, System Load, Wireless, Pacman, Maildir
2009-07-29 17:59:32 +02:00