diff options
author | Adrian C. (anrxc) <anrxc@sysphere.org> | 2009-10-04 16:26:34 +0200 |
---|---|---|
committer | Adrian C. (anrxc) <anrxc@sysphere.org> | 2009-10-04 16:26:34 +0200 |
commit | af4e85f99d0ac63127f19640ef47d768d7bed7cd (patch) | |
tree | 333d18d479ce6e58e77e03d0db9d88edcd67012a /thermal.lua | |
parent | fcf1027cb5603ffd9b3275abc53448e480cdd183 (diff) | |
download | vicious-legacy-af4e85f99d0ac63127f19640ef47d768d7bed7cd.tar.xz |
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.
Diffstat (limited to 'thermal.lua')
-rw-r--r-- | thermal.lua | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/thermal.lua b/thermal.lua index 7f31a52..ab7ef89 100644 --- a/thermal.lua +++ b/thermal.lua @@ -17,8 +17,7 @@ module("vicious.thermal") local function worker(format, thermal_zone) -- Get an ACPI thermal zone local f = io.open("/proc/acpi/thermal_zone/" .. thermal_zone .. "/temperature") - -- Fix your ACPI setup, or find another source of temperature - -- exposed trough /sys, if a thermal_zone can't be found + -- Handler for incompetent users if not f then return {"N/A"} end local line = f:read("*line") f:close() |