This commit is contained in:
Jörg Thalheim 2012-04-01 14:56:14 +02:00
commit a8a5fc14f6
3 changed files with 27 additions and 5 deletions

21
CHANGES
View File

@ -2,6 +2,27 @@
Full changelog is available online: Full changelog is available online:
http://git.sysphere.org/vicious/log/?showmsg=1 http://git.sysphere.org/vicious/log/?showmsg=1
--------------------------------------------------- ---------------------------------------------------
f972955 README: update thermal documentation
5605030 thermal: change coretemp default, allow file as widget argument
7a3699c division by zero, if battery is full charged
b11bb78 hddtemp: fix curl hang in version 7.24.0
73db82b README: add format function example for overriding symbols
7e81bb8 cpufreq: differentiate between ondemand and conservative
6f42ee5 README: update wtype argument explanation
45c6eba bat: fix time calculation, bug introduced in 350e924
cd4b04d thermal: remove unnecessary read
350e924 bat: another workaround for broken ACPI implementations
eeb27a2 [cpu] fix division by zero
059442d net: sanitize time computation to avoid division by zero
25b375b [pulse] round volume to integer
18e1823 vicious: cleanup tabs and bad intendation
cf996f2 [net] calculate time in a more clean way
f1844de Allocate reg table with all values in one shot
b11d251 README: provide multigraph usage example
44aea37 bat: better fix for missing rate in 31d7b2f
e01a8eb vicious: document mem.bcuse
1384b69 mem: provide mem.bcuse for Gabriel
324563e Next release, tag 2.0.3
dcc2b60 vicious: load widget modules only when needed dcc2b60 vicious: load widget modules only when needed
06e8f7c mpd: allow named keys or positional arguments 06e8f7c mpd: allow named keys or positional arguments
729ceb7 dio: import string.match() 729ceb7 dio: import string.match()

7
README
View File

@ -132,9 +132,10 @@ vicious.widgets.cpufreq
vicious.widgets.thermal vicious.widgets.thermal
- provides temperature levels of ACPI and coretemp thermal zones - provides temperature levels of ACPI and coretemp thermal zones
- takes the thermal zone as an argument, i.e. "thermal_zone0", or a - takes the thermal zone as an argument, i.e. "thermal_zone0", or a
table with 1st field as thermal zone and 2nd as data source - table with 1st field as thermal zone, 2nd as data source -
available data sources are "proc", "core" and "sys" - which is the available data sources are "proc", "core" and "sys" (which is the
default when only the zone is provided default when only the zone is provided) and 3rd optional argument
as a temperature input file to read
- returns 1st value as temperature of requested thermal zone - returns 1st value as temperature of requested thermal zone
vicious.widgets.uptime vicious.widgets.uptime

View File

@ -22,7 +22,7 @@ local function worker(format, warg)
local zone = { -- Known temperature data sources local zone = { -- Known temperature data sources
["sys"] = {"/sys/class/thermal/", file = "temp", div = 1000}, ["sys"] = {"/sys/class/thermal/", file = "temp", div = 1000},
["core"] = {"/sys/devices/platform/", file = "temp1_input",div = 1000}, ["core"] = {"/sys/devices/platform/", file = "temp2_input",div = 1000},
["proc"] = {"/proc/acpi/thermal_zone/",file = "temperature"} ["proc"] = {"/proc/acpi/thermal_zone/",file = "temperature"}
} -- Default to /sys/class/thermal } -- Default to /sys/class/thermal
warg = type(warg) == "table" and warg or { warg, "sys" } warg = type(warg) == "table" and warg or { warg, "sys" }
@ -30,7 +30,7 @@ local function worker(format, warg)
-- Get temperature from thermal zone -- Get temperature from thermal zone
local thermal = helpers.pathtotable(zone[warg[2]][1] .. warg[1]) local thermal = helpers.pathtotable(zone[warg[2]][1] .. warg[1])
local data = thermal[zone[warg[2]].file] local data = warg[3] and thermal[warg[3]] or thermal[zone[warg[2]].file]
if data then if data then
if zone[warg[2]].div then if zone[warg[2]].div then
return {data / zone[warg[2]].div} return {data / zone[warg[2]].div}