Temperature Display Pet for Lucid

Miscellaneous tools
Post Reply
Message
Author
JustGreg
Posts: 782
Joined: Tue 24 May 2005, 10:55
Location: Connecticut USA

Temperature Display Pet for Lucid

#1 Post by JustGreg »

Jemimah's excellent traytemp does not work under Puppy 5.0 Lucid. Here is a small BASH / GTKDialog script to display the acpi temperature value in a small window. The pet installs the script chck-temp to /usr/bin, the usual desktop file to /usr/share/applications and an icon to /usr/local/lib/X11/mini-icons. After the pet installs, there is a entry of Check Temperature in the Utility / General Utilities menu. With a little editing, one can have in the launcher section (next to Menu button) of JWM tray.

This does not monitor the temperature, so no warnings are given. But, it does allow one to check on it.

17 June 2010, I found a better looking thermometer image.

24 June 2010, I incorporated the code from rcrsn51 to handle the different versions of the file name with the temperature data

I hope this is a help.
Attachments
check-temp.pet
(8.25 KiB) Downloaded 1286 times
Last edited by JustGreg on Thu 24 Jun 2010, 16:08, edited 5 times in total.
Enjoy life, Just Greg
Live Well, Laugh Often, Love Much

User avatar
8-bit
Posts: 3406
Joined: Wed 04 Apr 2007, 03:37
Location: Oregon

#2 Post by 8-bit »

It would do me no good on my Toshiba Satellite L550 laptop.
It seems it does not have any readable temperature sensors.
At least I could never get any results from pwidgets.
pwidgets also says it can find no fan.
The laptop has a fan.
But at the same time, hardware info reports the temperature as 51 Celsius.
I installed CPU frequency scaling tool also.

JustGreg
Posts: 782
Joined: Tue 24 May 2005, 10:55
Location: Connecticut USA

#3 Post by JustGreg »

This pet is very simple. Try entering this code in a console terminal window (urxvt):

Code: Select all

cat /proc/acpi/thermal_zone/THRM/temperature
If it returns the temperature, then this pet should work. For example, my system returns in response:

Code: Select all

temperature:             54 C
It sounds like the information is there if hardware info reports the temperature.
Last edited by JustGreg on Thu 17 Jun 2010, 13:30, edited 1 time in total.
Enjoy life, Just Greg
Live Well, Laugh Often, Love Much

User avatar
prehistoric
Posts: 1744
Joined: Tue 23 Oct 2007, 17:34

borrowed code for md5sums

#4 Post by prehistoric »

Hi Greg,

I just borrowed a little code to display md5sums for iso files. This allowed me to add this to a custom ROX menu for iso files without putting gtkhash in luci 203. (Myself, I use gtkhash, but I don't want to force the overhead on everyone.)

Code: Select all

#!/bin/sh
# For use with Puppy 5.0 Lucid, JustGreg 15 June 2010
# (for application to read CPU temperature)
# Based on  Zigbert's guide to gtkdialog post,
# http://www.murga-linux.com/puppy/viewtopic.php?t=38608
# used by prehistoric to create a tiny script to display md5sums
# 16 June 2010

TEXT=`md5sum $@ | tr "[:blank:]" "\r"`

export script='
<vbox>
 <text> 
  <label>md5sum: '$TEXT'</label>
 </text>
 <hbox homogeneous="true">
  <button ok><action>Exit:0</action></button>
 </hbox>
</vbox>'
 
gtkdialog3 --program=script 
## exit from another poster on ubuntu
unset script #this ensures removal from memory
##  <hbox>
##  </hbox>
This is so small and crude, I didn't feel it deserved to be a pet. It got me around the problem of waiting until someone reads the result before vanishing.

JustGreg
Posts: 782
Joined: Tue 24 May 2005, 10:55
Location: Connecticut USA

#5 Post by JustGreg »

From Prehistoric:
This is so small and crude, I didn't feel it deserved to be a pet. It got me around the problem of waiting until someone reads the result before vanishing
I glad it was a help to you. I would not call it crude, since gtkdialog contains some elegant programing. I will agree it is simple. I based it on the classic "Hello World" program and added a centered button to exit. The pet packaging is the standard method of providing new items to puppy. Use of the pet makes it painless to install or remove.

The program is a handy way of displaying simple information. I hope others use the approach. Thank you for the feed back.
Enjoy life, Just Greg
Live Well, Laugh Often, Love Much

User avatar
nitejumper
Posts: 2
Joined: Tue 22 Jun 2010, 04:35
Location: Tampa, FL

system tray temperature in Lucid 5.01

#6 Post by nitejumper »

First post for me, thanks everybody for the help I've gotten over the past 3 months with Puppy.

8bit, et al, the command to read temperature in MY machine is "cat /proc/acpi/thermal_zone/THM/temperature".

Notice the spelling of 'THM'.
----------------------------------------

I've been wanting a digital temperature display for my system tray in Icewm, but haven't been able to find one. I cobbled this thing together (my first program that compiled, and my first time making PNGs).

Since I had just modified pbatt to show battery percentage icons, I borrowed heavily from brad_chuck's program (in fact, the header in the source code still calls itself 'pbatt'). I just cut stuff out of 'bevent' until it did what I wanted.

Since I'm already running pbatt (with percentage icons), new program had to call a bash script named something other than 'bevent' ('cause that's what is called by pbatt), but otherwise, the main program is identical to 'pbatt'.

I put the main program (temp_tray5) in /usr/bin, the folder with all the PNGs in /usr/local, and added this line to /root/Startup/icewm -

sleep 1 && temp_tray5 &

it works, at least for me, YMMV.
------------------------------------------
next project is to modify 'freememapplet_tray_215ce' to display CPU load percentage in the system tray.
------------------------------------------
nitejumper
Attachments
temp_tray.tar
(99.5 KiB) Downloaded 1008 times
74.png
(954 Bytes) Downloaded 3031 times
44.png
(942 Bytes) Downloaded 3008 times

JustGreg
Posts: 782
Joined: Tue 24 May 2005, 10:55
Location: Connecticut USA

#7 Post by JustGreg »

Nitejumper, it is interesting that on your system, the temperature information is in directory

Code: Select all

cat /proc/acpi/thermal_zone/THM/temperature
On my Acer Asprie Revo using Lucid Puppy 5.0, the directory location is:

Code: Select all

cat /proc/acpi/thermal_zone/THRM/temperature
I have noticed that Lucid Puppy 5.0 does not run/have the kernel module acpid like Quirkly and Pupeee. It is nice to see another approach. I will take a look at it. I am running jwm for the window manager so the icewm approach needs to be modified for my configuration.
Enjoy life, Just Greg
Live Well, Laugh Often, Love Much

User avatar
nitejumper
Posts: 2
Joined: Tue 22 Jun 2010, 04:35
Location: Tampa, FL

#8 Post by nitejumper »

JustGreg said:
I have noticed that Lucid Puppy 5.0 does not run/have the kernel module acpid like Quirkly and Pupeee.
I just checked in Puppy Package Manager and found that I installed 'acpid-1.0.10-i486.pet' and 'acpitool-0.5.1-i486.pet' (found somewhere around here) recently - I was trying to get 'Suspend-to-RAM' working (and that still hasn't happened).

I worked with Puppy 4.31 for a short time before this one, and I love 5.01, - blazingly fast, more stable than WinXP, and infinitely configurable.

BTW, I just got a CPUload percentage working in the taskbar (digital, not analog). Hacked the source code from 'freememapplet_tray_215ce' from Lior Tubi (it works on my machine - none of the other versions work for me, but the text is still too big for the icon space), and 'cpu_test' from Paul Colby.

I changed the background to a comfortable green, with black text, but the text is too 'light' to jump off the screen without focusing on it.
I'm still looking for solutions to change either the taskbar width or make the font bold, but apparently, GTK doesn't let me change the font from what's defined in gtkrc.

-----------------------
niejumper

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

#9 Post by rcrsn51 »

JustGreg wrote:Nitejumper, it is interesting that on your system, the temperature information is in directory

Code: Select all

cat /proc/acpi/thermal_zone/THM/temperature
On my Acer Asprie Revo using Lucid Puppy 5.0, the directory location is:

Code: Select all

cat /proc/acpi/thermal_zone/THRM/temperature
I have a machine that uses THM0. The solution is some code like this:

Code: Select all

THRMFILE=`find /proc/acpi/thermal_zone -name "temperature"`
TEMP=`cat $THRMFILE | cut -c25-30`

JustGreg
Posts: 782
Joined: Tue 24 May 2005, 10:55
Location: Connecticut USA

#10 Post by JustGreg »

Thanks, rcrsn51. I will add the code and try it out. If it works then I will post the new pet. It did work properly. I have updated the pet (first post) with the improved script. Thanks for the help!

Nitejumper, the acpitool works nicely with Lucid. It is a handy "add-on" for laptops, net books, etc. I have added it to my Lucid installation. Be careful with the acpid pet. The program acpid should be a kernel module. If acpid module was not build for the kernel (2.6.33.2) then it will not install and work. You need to check to ensure there are no problems. I have no experience with the particular pet that you mentioned, so I can not help on its use. But, I have tried using kernel modules and found the it can be difficult to get added one to work properly. I hope this helps.
Enjoy life, Just Greg
Live Well, Laugh Often, Love Much

Post Reply