Any way to show CPU temp in Xfce taskbar in 431 NOP? (solved

Requests go here. If you fill a request, give it a new thread in the appropriate category and then link to it in the request thread.
Post Reply
Message
Author
User avatar
TLM
Posts: 183
Joined: Tue 09 Mar 2010, 05:14
Location: Central United States

Any way to show CPU temp in Xfce taskbar in 431 NOP? (solved

#1 Post by TLM »

Is there a way to display the cpu temp in the Xfce taskbar in 431 NOP? I would like it in Fahrenheit if possible. Hard Info shows my sensors Core0 Temp as 42 degrees Celsius. I would like to get that information displayed in my taskbar at all times. Is there a PET anywhere for this? I have found batmon and CPUtemp PETS. I can run CPUtemp from the command line and get an X message about the temperature, however I do not know enough about programming to get the CPU temp into my taskbar. Thank you for any help.
Last edited by TLM on Tue 01 Feb 2011, 04:18, edited 1 time in total.

User avatar
TLM
Posts: 183
Joined: Tue 09 Mar 2010, 05:14
Location: Central United States

#2 Post by TLM »

OK, trying to help myself, I have come across this link:

http://goodies.xfce.org/projects/panel- ... mon-plugin

But I do not know how to get or use the sample script shown. However it seems to me that genmon (which NOP 431has) could be used to display the cpu temp. Any ideas? Thanks very much.

User avatar
rjbrewer
Posts: 4405
Joined: Tue 22 Jan 2008, 21:41
Location: merriam, kansas

#3 Post by rjbrewer »

Don't know if this works in xfce but it's great in the jwm taskbar
or as a small icon on desktop.

http://murga-linux.com/puppy/viewtopic. ... 94&t=57480

Inspiron 700m, Pent.M 1.6Ghz, 1Gb ram.
Msi Wind U100, N270 1.6>2.0Ghz, 1.5Gb ram.
Eeepc 8g 701, 900Mhz, 1Gb ram.
Full installs

User avatar
TLM
Posts: 183
Joined: Tue 09 Mar 2010, 05:14
Location: Central United States

#4 Post by TLM »

Yes i found that pet, but i cannot use it in Xfce because the directory root/.jwmrc-tray is for jwm desktop, and I cannot find the Xfce counterpart, nor even know if it would work if I could. I am pretty sure that genmon in the Xfce taskbar can be made to show the cpu temp, but I do not know what command to enter when configuring genmon.

G0XAN
Posts: 31
Joined: Fri 08 May 2009, 18:52
Location: Brighton, UK

#5 Post by G0XAN »

Genmon is the right solution, but it does need some more work to display what you want.

First off, you need a script to read the temperature and convert it from C to F. This script will do it for you:

Code: Select all

#!/bin/bash

vCpuTemp=$(cat /proc/acpi/thermal_zone/THRM/temperature | awk '{print $2}')
vCpuTempUnits=$(cat /proc/acpi/thermal_zone/THRM/temperature | awk '{print $3}')

if echo "$vCpuTempUnits" | grep -q "C"
then
let "vCpuTemp *= 9"
let "vCpuTemp /= 5"
let "vCpuTemp += 32"
fi

echo $vCpuTemp" F"
You might have to change the path in the "cat" commands to get to the temperature sensor in your particular PC. Look around in /proc and you should find it.

Copy & paste the script into a text file and save it somewhere, I use

Code: Select all

/root/my-scripts
and call the script cpuTemp

Then make the script executable. Open a terminal window, go to your script directory and change the script properties:

Code: Select all

cd /root/my-scripts
chmod +x cpuTemp
Now right-click on the genmon panel, i.e. the net or memory monitor on the right of the task-bar and select "Add New Items..."
Scroll down the list to "Generic Monitor", select it and click on "Add"
In the Configuration window, in the Command box type

Code: Select all

/root/my-scripts/cpuTemp
Clear the tick-box next to "Label" and set the "Period (s)" to something suitable (e.g. 10)
Click "Close" and your CPU temperature will appear in Fahrenheit.
All done! :)

If it doesn't work as you expect, you can run the cat command in a terminal window and see what format your temperature is reported in. You might need to adjust the awk commands to suit.

I'm sure someone else could write a neater script, but this one works for me! Hope it helps...
Gary

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#6 Post by rcrsn51 »

TLM wrote:Yes i found that pet, but i cannot use it in Xfce because the directory root/.jwmrc-tray is for jwm desktop, and I cannot find the Xfce counterpart, nor even know if it would work if I could. I am pretty sure that genmon in the Xfce taskbar can be made to show the cpu temp, but I do not know what command to enter when configuring genmon.
The newest version 1.2 of CPUtemp does not use jwmrc-tray, so it works in 431NOP. Just install the PET and reboot.

User avatar
TLM
Posts: 183
Joined: Tue 09 Mar 2010, 05:14
Location: Central United States

#7 Post by TLM »

GOXAN and rcrsn51, Thank you for your how to. I am running the CPUtemp and it shows my temp when I click on it. GOXAN, i will need some more time to test your scripts, but am looking forward to it. Thanks again.

User avatar
TLM
Posts: 183
Joined: Tue 09 Mar 2010, 05:14
Location: Central United States

#8 Post by TLM »

GOXAN, Your script worked perfectly without any modifications! I have migrated to Puppy from Windows XP and was looking for something to replace CoreTemp I had been using in XP. Your howto solved it. Thanks!

G0XAN
Posts: 31
Joined: Fri 08 May 2009, 18:52
Location: Brighton, UK

#9 Post by G0XAN »

Glad to be of help!
If you could now add [solved] to the title of the thread, then one of the moderators can move it to the appropriate category.
Gary

Post Reply