
KTemperature
Source (link to git-repo or to original if based on someone elses unmodified work):
The application obtains the system temperature from the file /proc/acpi/thermal_zone/THRM/temperature .
I have been using Linux and Open Source for quite sometime and this is my first contribution. I hope this will lead to
many more contributions from me.
SuSE 9.2 rpm for the i686 platform is available for download.
The available rpm also works for SuSE 9.3.
The rpm available for download can be installed on SuSE 10.0 as well.
Version 1.1
Added check for the presence of /proc/acpi/thermal_zone/THRM/temperature file. If the file is not present the temperature will be displayed as NA.
Version 1.2
Corrected typo.
Visual representation of the "hotness" of the system.
The system maximum temperature can be provided as an input. The system tray icon will change redness depending on the ratio of provided maximum temperature to the current temperature.
Version 1.3
Configurable temperature monitoring interface, can be anything as long as the temperature can be obtained by doing a read operation on the file.
Stored configuration. The configuration is stored in $HOME/.ktemperatue and read on startup.
Increased sensitivity of redness to temperature changes.
Version 1.4
Auto adjusting text font. The color of the text adjusts to a compliment of the background color, This ensures that the text is clearly visible irrespective of the redness of the systray icon.
More prominent text. The text is bold faced and the font of the text is bigger.
Version 1.5
Changes of parameters (polling interval and max, temperature) take instantaneous effect without having to restart the application.
Boundary values cases of redness, the calculation of redness difference between the background and the foreground has been modified to ensure a minimum difference.
Text alignment, the temperature text will be aligned in the middle both vertically and horizontally.
Version 1.6
Auto loading of the neccessary ACPI thermal module and its dependencies if, required. The root password is checked prior to loading the modules.
Detection of two variants of the thermal interface, namely
/proc/acpi/thermal_zone/THRM and
/proc/acpi/thermal_zone/THM
Version 1.7
The ACPI thermal interface was being detected by searching the /proc/modules file. However, that approach will lead to an irritating request for root password in cases where the module in compiled into the kernel. The thermal interface detection has been modified to take care of the above case.
Version 1.8
Added Pause, Restart and Update options in the right click menu for more control of polling.
Cleaned the auto detection of ACPI thermal interface. The first file in the thermal_zone directory(other than .. and .)is taken as the temperature file.
Fixed the width of the main window to be always greater than the width of widest child window.
Version 1.9
Changed the implementation of 'redness' from RGB space to HSV space for greater sensitivity.
The background color changes from green at minimum temperature to red at maximum temperature.
The text is always constant and will have a clear contrast all temperatures.
Replace memcpy with strcpy in monitor interface selection.
Interface(s) selected in the drop down list will be honoured when the Set button is clicked after the selection.
Used grid layout for the main widget.
Version 1.9-1
Created archive to include version information.
Added keyboard shortcuts to right click menu options.
Added caption to root password dialog.
I would like to acknowledge the suggestions that I have received. The changes have been made taking into account these suggestions.
Ratings & Comments
58 Comments
Hi First things first, I love the idea. Really. It's exactly what I was looking for. Good job. However, I can't make it work. The problem comes from me I guess. I have the /proc/acpi/thermal_zone directory, but... it's empty! How come? Is there a way to fix it? Thank you.
Solution: Put any png-file in the file-field. It works.
the page seems to force an .exe file (lmao), good thing this is a Linux site or some OS's coulda been hurt (^.^)
The Download link seems to go to a domain parking site by GoDaddy. You may should probably renew the domain. Is anyone mirroring this?
A suggestion (or two!): 1) The temperature display font needs to be user adjustable, or better yet, somehow auto-adjusted to fit, as it doesn't fit on all size panels. Screenshot here: http://users.tpg.com.au/drtwox/ktemp.png 2) Perhaps this type of app would be more suited to being a panel applet.
It would be nice if it were more customizable. For example on my laptop I find that my hard drive gets a bit hot as well... This can be monitored with something like "smartctrl -a /dev/hda | grep Temperature". It would be cool to also monitor cpu speed "cat /proc/cpuinfo | grep MHz" (although this is no longer temperature)
i don't have /proc/acpi/thermal_zone.... can i get that or what?
It could that your system does not support ACPI, typically older systems have APM. If ACPI is supported then check if there is a /proc/acpi directory. If there is no ACPI directory try loading the acpi, processor and thermal modules.
i've the same problem. my acpi module is static in kernel and i have this dir tree: $ dir -R .: ac_adapter button event info thermal_zone alarm dsdt fadt power_resource video battery embedded_controller fan processor wakeup ./ac_adapter: ./battery: ./button: power ./button/power: PWRB PWRF ./button/power/PWRB: info ./button/power/PWRF: info ./embedded_controller: ./fan: ./power_resource: ./processor: CPU0 ./processor/CPU0: info limit power throttling ./thermal_zone: ./video: When i load ktemperature ut it return me: $ ktemperature libpng error: Not a PNG file any idea ??
The libpng error does not impact the running of the application and it has nothing to do whether the acpi is statically compiled in or dynamically loaded. However, if the thermal_zone directory is present then the application should not ask for loading the themral module. The interface can be selected using the file selection.
My ACPI support in enabled into kernel with all sub-options This is my config: http://phpfi.com/84405 Any idea ?
If ACPI is statically compiled, then there should be an acpi directory in /proc. The acpi directory in turn should have a themral_zone directory. The thermal_zone directory should have a file entry giving the temperature of the system. Once you have identified the file please set it in KTemperature. I hope this helps.
[quote] i've the same problem. my acpi module is static in kernel and i have this dir tree: $ dir -R .: ac_adapter button event info thermal_zone alarm dsdt fadt power_resource video battery embedded_controller fan processor wakeup ./ac_adapter: ./battery: ./button: power ./button/power: PWRB PWRF ./button/power/PWRB: info ./button/power/PWRF: info ./embedded_controller: ./fan: ./power_resource: ./processor: CPU0 ./processor/CPU0: info limit power throttling ./thermal_zone: ./video: When i load ktemperature ut it return me: $ ktemperature libpng error: Not a PNG file any idea ??[/quote]
Hola I had the same problem. The reason was that the temperature file can be in different locations. In my case it was in /proc/acpi/thermal_zone/THM0/temperature You can set the location of the file in the control menu, that pops up, if you left click on KTemperature's toolbar icon (the one that shows NA) The "Not a PNG file" bug, mentioned by someone else, I experience, too, when I start from command line, but it does not keep KTemperature from running properly. Best thowe
I've got an error message with ktemperature 1.9.1-0 and the trayicon in is missing (shows "NA"): ~> ktemperature libpng error: Not a PNG file I'm running SuSE 9.3 with KDE 3.4.2 Level "b". Any halp?
I am not sure why the libpng error is logged. It could be because the included .png files are not proper. However, the error does not effect the performane of the application. As far as the NA is concerned, do you have the acpi thermal module loaded ? If it is loaded check if there is a /proc/acpi/thermal_zone/TH*M/temperature and if there is an entry, right click on the system tray select restore and configure the monitoring interface. I hope this helps.
I changed the reference file to the temperatur file in THRC dir: # ls /proc/acpi/thermal_zone/THR* /proc/acpi/thermal_zone/THRC: . .. cooling_mode polling_frequency state temperature trip_points /proc/acpi/thermal_zone/THRS: . .. cooling_mode polling_frequency state temperature trip_points Now the display of the temp sensor works fine. Thanx. Regards, Juergen
This is exactly what I needed! Well done! Thanks!
Hello, Is there a way to have a popup when a critical temperature is reached ? If not, it would be nice.
Currently, there is no alarm indication when the maximum temperature is reached. I did not add an alarm since, I was not sure whether it would be a good idea to force more work (and increase temperature further) when the system is at its maximum temperature.
we need the option to select which background colour and font the tray icon will use.
The background color changes depending on the temperature. As far the font and size of the temperature, I will try to make them configurable.
Is there a way to prevent your app from asking the root pw? I really hate user input, even though I don't reboot often. I first thought that by adding modprobe to /etc/sudoers it would stop asking, but it didn't. How can I let the app stop asking, or can you implement functionality so that it does not need to ask? I don't really know how the program itself works, and I guess more people would like this feature so I'll give you the pleasure to start coding! :-) PS. The program is great though, the best I found! I wanted this functionality after my pc locked when the CPU got overheated on a hot summer day while playing Enemy Territory. :-D
The utility is asking for the root password to load the ACPI thermal module since it has detected that the monitoring interface is not present. If you can ensure that the ACPI thermal module is loaded by the time utility runs or if you compile it into the kernel then the root password will not be asked. In the next version I will try to make changes so that the root password will not be asked if not required.
Thanks, that does solve my problem. Is seems that I needed to append 'thermal' to the file /etc/moprobe.preload .