Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Mon 20 Oct 2014, 19:32
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Utilities
Temperature Display Pet for Lucid
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [10 Posts]  
Author Message
JustGreg

Joined: 24 May 2005
Posts: 695
Location: Connecticut USA

PostPosted: Wed 16 Jun 2010, 15:06    Post subject:  Temperature Display Pet for Lucid
Subject description: Uses BASH / GTKDIALOG
 

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.
check-temp.pet
Description 
pet

 Download 
Filename  check-temp.pet 
Filesize  8.25 KB 
Downloaded  786 Time(s) 

_________________
Enjoy life, Just Greg
Live Well, Laugh Often, Love Much

Last edited by JustGreg on Thu 24 Jun 2010, 12:08; edited 5 times in total
Back to top
View user's profile Send private message 
8-bit


Joined: 03 Apr 2007
Posts: 3380
Location: Oregon

PostPosted: Wed 16 Jun 2010, 18:25    Post subject:  

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.
Back to top
View user's profile Send private message 
JustGreg

Joined: 24 May 2005
Posts: 695
Location: Connecticut USA

PostPosted: Wed 16 Jun 2010, 19:01    Post subject:
Subject description: 8-bit, try this
 

This pet is very simple. Try entering this code in a console terminal window (urxvt):
Code:
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:
temperature:             54 C

It sounds like the information is there if hardware info reports the temperature.

_________________
Enjoy life, Just Greg
Live Well, Laugh Often, Love Much

Last edited by JustGreg on Thu 17 Jun 2010, 09:30; edited 1 time in total
Back to top
View user's profile Send private message 
prehistoric


Joined: 23 Oct 2007
Posts: 1296

PostPosted: Wed 16 Jun 2010, 20:27    Post subject: borrowed code for md5sums  

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:
#!/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.
Back to top
View user's profile Send private message 
JustGreg

Joined: 24 May 2005
Posts: 695
Location: Connecticut USA

PostPosted: Thu 17 Jun 2010, 09:27    Post subject:  

From Prehistoric:
Quote:
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
Back to top
View user's profile Send private message 
nitejumper


Joined: 22 Jun 2010
Posts: 2
Location: Tampa, FL

PostPosted: Tue 22 Jun 2010, 08:27    Post subject: system tray temperature in Lucid 5.01
Subject description: this works for me in Icewm
 

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
temp_tray.tar
Description 
tar

 Download 
Filename  temp_tray.tar 
Filesize  99.5 KB 
Downloaded  572 Time(s) 
74.png
 Description   
 Filesize   954 Bytes
 Viewed   2316 Time(s)

74.png

44.png
 Description   
 Filesize   942 Bytes
 Viewed   2396 Time(s)

44.png

Back to top
View user's profile Send private message 
JustGreg

Joined: 24 May 2005
Posts: 695
Location: Connecticut USA

PostPosted: Tue 22 Jun 2010, 14:06    Post subject:  

Nitejumper, it is interesting that on your system, the temperature information is in directory
Code:
cat /proc/acpi/thermal_zone/THM/temperature
On my Acer Asprie Revo using Lucid Puppy 5.0, the directory location is:
Code:
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
Back to top
View user's profile Send private message 
nitejumper


Joined: 22 Jun 2010
Posts: 2
Location: Tampa, FL

PostPosted: Wed 23 Jun 2010, 19:20    Post subject:  

JustGreg said:

Quote:
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
Back to top
View user's profile Send private message 
rcrsn51


Joined: 05 Sep 2006
Posts: 9198
Location: Stratford, Ontario

PostPosted: Thu 24 Jun 2010, 08:44    Post subject:  

JustGreg wrote:
Nitejumper, it is interesting that on your system, the temperature information is in directory
Code:
cat /proc/acpi/thermal_zone/THM/temperature
On my Acer Asprie Revo using Lucid Puppy 5.0, the directory location is:
Code:
cat /proc/acpi/thermal_zone/THRM/temperature

I have a machine that uses THM0. The solution is some code like this:
Code:
THRMFILE=`find /proc/acpi/thermal_zone -name "temperature"`
TEMP=`cat $THRMFILE | cut -c25-30`
Back to top
View user's profile Send private message 
JustGreg

Joined: 24 May 2005
Posts: 695
Location: Connecticut USA

PostPosted: Thu 24 Jun 2010, 08:58    Post subject:  

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
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [10 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Utilities
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0788s ][ Queries: 12 (0.0045s) ][ GZIP on ]