CPU core temperature with Vicious without ACPI

After struggling for a while with Vicious, a widget set for the Awesome window manager (who could really use a more search-friendly name), I finally managed to use it for displaying the CPU temperature in my machine.

My first problem is that ACPI does not show temperature information in my machine, and I didn’t know what should I do. I tried reading /proc stuff, and using this acpitool program, but I olny got that:

$ acpitool -t
  Thermal info   : <not available>

After some research I finally installed a certain lm_sensors package (I use Debian) to use a program called “sensors”. (it seems things are migrating away from proc, and this program is the “new way”). Then I installed sensors-detect that finally told me what module I should load to get the reading!… Phew, what a journey. I only wish modconf had a search functionality! 😦

After all that, I was finally able to run

$cat /sys/devices/platform/coretemp.0/temp1_input
49000

to find out the temperatures.

With that set up, I then finally went on to configure my rc.lua script, copying from lots of places. You basically need to first copy the vicious directory to ~/.config/awesome/ (or whatever is your XDG thing directory) to install it, and then you need to put the “require” line, and initialize the widget like this

-- {{{ CPU temperature
local thermalwidget  = widget({ type = "textbox" })
vicious.register(thermalwidget, vicious.widgets.thermal, " - $1°C", 20, { "coretemp.0", "core"} )
-- }}}

All examples I found on Google had just the argument “thermal_zone0” at the end. To use the “core” option, you need to pass this list at the end, and write the directory name at the first position. After that you also have to put the widget on the widgets list, and there you go.

Here is how my top desktop bar looks like now:

Next step, putting my gmail inbox stats over there!…

Advertisements

2 thoughts on “CPU core temperature with Vicious without ACPI

  1. davethecipo

    Thanks! I solved on my laptop too. I just had to load the coretemp module at boot.

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s