Commit f3bcaabe authored by Vincent Tam's avatar Vincent Tam

Conky: ajout du script pour le commit préc.

parent f79fe261
-- Find the right `i` for `${hwmon [i] temp n}`
function conky_cputemp(n)
temp=conky_parse("${hwmon "..findHwmonNum().." temp "..n.."}")
return temp
end
-- Test if /sys/class/hwmon/hwmonI/temp3_crit exists for I=0,...,10
-- Increase `10` to cover the number of directories /sys/class/hwmon/hwmonN
function findHwmonNum()
for i = 0,10,1 do
if file_exists("/sys/class/hwmon/hwmon"..i.."/temp3_crit") then
return i
end
end
end
-- https://stackoverflow.com/a/4991602/3184351
function file_exists(name)
local f=io.open(name,"r")
if f~=nil then io.close(f) return true else return false end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment