mirror of
https://github.com/vicious-widgets/vicious
synced 2023-12-14 07:13:07 +01:00
hddtemp: fixed support for multiple devices
This commit is contained in:
parent
1790abb0ed
commit
3834caa904
1 changed files with 3 additions and 4 deletions
|
@ -7,7 +7,7 @@
|
|||
local tonumber = tonumber
|
||||
local io = { popen = io.popen }
|
||||
local setmetatable = setmetatable
|
||||
local string = { match = string.match }
|
||||
local string = { gmatch = string.gmatch }
|
||||
-- }}}
|
||||
|
||||
|
||||
|
@ -25,9 +25,8 @@ local function worker(format, port)
|
|||
local hdd_temp = {}
|
||||
|
||||
for line in f:lines() do
|
||||
local disk, temp = string.match(line, "|([%/%a%d]+)|.*|([%d]+)|[CF]+|")
|
||||
|
||||
if disk ~= nil and temp ~= nil then
|
||||
for disk, temp in string.gmatch(line, "|([%/%a%d]+)|.-|([%d]+)|[CF]+|")
|
||||
do
|
||||
hdd_temp["{"..disk.."}"] = tonumber(temp)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue