-
Notifications
You must be signed in to change notification settings - Fork 32
Trying to use this with Conky, but having some issues #13
Copy link
Copy link
Open
Description
Hey there,
I am sure I am doing something incorrectly, but I am new to LUA, so I am not quite sure what I am doing wrong.
Here is essentially what I am trying to do:
Code block using sh
function parts.cputemp(colorBg)
-- local command = "zsh -c \'/home/mosthated/_dev/languages/sh/temps.zsh \"Tccd1\"'"
-- local temp = _h.exec("zsh -c \'/home/mosthated/_dev/languages/sh/temps.zsh \"Tccd1\"'")
-- local temp = sh.command(command)
-- Trying to run this command to return a single numeric value (30.1, 35.6, etc)
local temp = sh.command('zsh','-c', '/home/mosthated/_dev/languages/sh/temps.zsh', 'Tccd1')
local cputemp = [[\
-- Then I wanted to reuse that same value throughout the rest of the script block
${if_match ]].. temp .. [[<45}\
]] .. _h.value(temp .. '°C', ci.good) .. [[
${else}${if_match ]].. temp ..[[<55}\
]] .. _h.value(temp .. '°C', ci.degraded) .. [[
${else}${if_match ]].. temp ..[[>=55}\
]] .. _h.value(temp .. '°C', ci.bad) .. [[
${endif}${endif}${endif}\
]]
return _h.common('', 'CPU', cputemp, colorBg)
end${if_match ]].. temp() .. [[<45}\
]] .. _h.value(temp() .. '°C', ci.good) .. [[
That then gives me the message of : attempt to call a table value
I also attempted to do tostring(temp()) but I believe that gave a message of: Bad arguments: 'function: 0x55c917c53460' and '45'
Might anyone have any insight on what I might need to change in order to properly get back the numeric value?
Thanks!
-MH
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels