From 5605030ed4ac28efe0430c2210fa507f97d9aa20 Mon Sep 17 00:00:00 2001 From: "Adrian C. (anrxc)" Date: Sat, 31 Mar 2012 20:53:30 +0200 Subject: 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. --- widgets/thermal.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'widgets') diff --git a/widgets/thermal.lua b/widgets/thermal.lua index 1906568..c81431f 100644 --- a/widgets/thermal.lua +++ b/widgets/thermal.lua @@ -22,7 +22,7 @@ local function worker(format, warg) local zone = { -- Known temperature data sources ["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"} } -- Default to /sys/class/thermal warg = type(warg) == "table" and warg or { warg, "sys" } @@ -30,7 +30,7 @@ local function worker(format, warg) -- Get temperature from thermal zone 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 zone[warg[2]].div then return {data / zone[warg[2]].div} -- cgit v1.2.3