You are not logged in.
Just wondering how I would go about incorporating the k10temp module temperature in an awesome widget.
If I type for example:
sensors | grep temp1I get the following information
temp1: +6.4°C (high = +70.0°C)
temp1: +24.0°C (low = +79.0°C, high = +65.0°C) sensor = thermistoThe first temp1 is the core and the next one is my socket temperature. The reason for the low temp is due to a closed water cooling loop.
How would I incorporate this information into a widget in Awesome?
A simple temperature widget is the following:
-- {{{ CPU temperature
local thermalwidget = widget({ type = "textbox" })
vicious.register(thermalwidget, vicious.widgets.thermal, " - $1°C", 20, { "coretemp.0", "core"} )
-- }}}But as you can see coretemp.0 is for Intel chips and not for AMD.
The file with the temp information is located at
/sys/module/k10temp/drivers/pci:k10temp/0000:00:18.3/temp1_inputHow would I apply this?
Offline
You could do it with io.popen and string.gsub, which are lua functions, and with timer and signals from Awesome library.
This is how you get the output in a string:
local f = io.popen("sensors | grep temp1")
local output = f:read("*all")
f:close()then you can process the string with string.gsub, there's plenty of docs online about how to.
Assuming you write all of this in a function which sets your widget, now you just need to define a timer, which periodically waits t_out seconds and calls function, connect a timeout signal on and start it:
local mytimer = timer({ timeout = t_out })
mytimer:connect_signal("timeout", function)
mytimer:start()EDIT: You can check my repos for some examples.
Last edited by sardina (2013-08-20 14:12:35)
Offline