
Simple CPU Sensor
Source (link to git-repo or to original if based on someone elses unmodified work):
Just shows temperature value without annoying decorations and animations. That's it.
FEATURES:
* Supports configurable overheat alerts.
* Designed to be embedded into panels.
* provides basic configuration:
- font size and styles
- overheat level and color
- normal color
- C or F units scale
- some other pretty neat things.
INSTALLATION:
- use KDE's "Get new hot stuff" to install.
MANUAL INSTALLATION:
- unpack downloaded archive.
- run ./install.sh
- select newly installed plasmoid from plasma widgets.
GITHUB: https://github.com/alex-oleshkevich/simple-cpu-sensor
PLEASE DO NOT REPORT ISSUES AND REQUESTS HERE. USE GITHUB PAGE FOR THAT!
1.1:
+ plasmoid now autodetects temperature sensor, as result:
+ added support of AMD processors
1.0:
+ migrated from Python to QML
+ added possibility to hide units sign (C or F) from being displayed
+ added "bold" and "italic" font styles
+ updated default styles
0.5.2:
+ added support for AMD FX processors (thanks to icewind1991)
0.5:
+ fixed issue when plasmoid was not able to get temperature on several hardware
+ added temperature units support (hello, America)
+ added support of Intel Core i5 M480
0.4:
+ added font settings (family and size)
+ thermal source changed to sysfs instead of deprecated procfs
- removed support of lm-sensors
0.3: Added configuration options via interface:
-- color
-- overheat color
-- check interval
-- selection of grabbing method
0.2: Temperature source changed to sensors in order to provide compatibility between different machines (so u need to have the lm-sensors package installed. The old method is still exists and commented out.
0.1: Initial release
Ratings & Comments
38 Comments
Please add a sensor for GPU Temps. I have a NVIDIA
Hi, I modified your nice widget (a small change in main.py). Now it automatically finds the device and shows both motherboard and cpu temperatures aside: https://dl.dropboxusercontent.com/u/10405722/my-simple-cpu-sensor.zip.plasmoid feel free to use it or to merge it with your for a new version. Roberto
Any chance of adding the ability to monitor the GPU temperature to this app? Love it's simplicity and there's nothing like it for GPU in KDE that I've noticed.
If you provide me a way how to get a temperature for GPU, then a new widget will appear on this site.
Thanks for the widget! In main.py in the function updateLabel you use: sensor = commands.getoutput("sensors | grep temp1"); In case sensors are not installed variable sensor would be a string like "command not found", so when you try to : t = int(float(sensor)) would raise a ValueError exception. The problem is that a user in the widget justs sees script initialization failed and has no clue that sensors are missing. So i suggest to do: try: t = int(float(sensor)) except ValueError: error_msg = 'Unable to get cpu temperature using sensors command, is sensors installed?' and in the end where you check to_show = t if (t > self.overheat_level): self.color = self.overheat_color elif ( t == -1): self.color = self.overheat_color to_show = error_msg self.label.setText('<font color="' + self.color + '"><b>' + str(to_show) + '° C</b></font>') So the widget tells the user what is the error. Probably you can do it with better code but just keep the idea :)
Hi :) Very nice plasmoid, but I had to fetch it from your git repo. Source download links to skeleton-plasmoid.zip.plasmoid. I see you just updated the link a few hours ago, so it may be sthg else. Thanks for this :)
Sorry for that -- my bad ;) I reuploaded the correct plasmoid.
Try to download, but I get just the version 0.2!
hi, this actually 0.3 version but manifest was not updated. Fixed.
hi, this is 0.3 version actually but manifest.desktop was not updated. Fixed.
Thank you. But now I see, that my problem is not caused by an old version. Yesterday I have installed your plasmoid and it works. Today I try to install the plasmoid on an other Notebook. It seems to work, but I cannot see the simple-cpu-sensor dialogue. So my first idea was, that this was caused by the not updated version of your plasmoid. But this was not the reason: I don't see the setting dialogue on the second notebook. Do you have any idea why?
Hm, probably. the reason is in your KDE version. Initially it was written for 4.6 and updated for 4.8 lately. Please, unpack the archive (this is a regular zip-archive) cd into simple-cpu-plasmoid directory and run "plasmoidviewer ." without quotes. If there (in terminal) would be any issues, please, post them here. If all is ok, just run "plasmapkg -u ." or execure reinstall.sh script. Also, after that actions execute "kbuildsycoca4"
The problem was not the KDE-version (same on both PC). The problem was due too the temperature detection on my second notebook. apci does not work and lm-sensors all times detect a constant value. After reinstall your plasmoid, I see the dialog on my second notebook too. Thank you very much for your help!
Hi I added a small feature to the plasmoid. It adds an inertial momentum to the temperature change. My CPU temperature oscillates between two values when idle (50-51°) and it is rather distracting to see the plasmoid reflect these changes. Now it will only display a change if there is a bigger difference (3°). This code snippet should be added to the init() function: Quote:
...
self.resetTimer = QtCore.QTimer()
self.resetTimer.setInterval(30000)
self.resetTimer.start()
QtCore.QObject.connect(self.resetTimer, QtCore.SIGNAL("timeout()"), self.resetOldTemp)
self.resetOldTemp()
self.timer = QtCore.QTimer()
self.timer.setInterval(2000)
self.timer.start()
QtCore.QObject.connect(self.timer, QtCore.SIGNAL("timeout()"), self.updateLabel)
self.updateLabel()
Also add the following snippet after the retrieval of the temperature in updateLabel():
Quote:
...
if (abs(t - self.oldTemp) > 3):
self.oldTemp = t
else:
t = self.oldTemp
...
and before setting the label text. One would have to experiment a bit with the threshold value but 3° seems to produce good results. The second timer used above is there to force showing the real temperature value if for a longer time (30s) there was no change otherwise the shown value can be off by +-2 and stay there. That's what the function below is needed for:
Quote:
def resetOldTemp(self):
self.oldTemp = 0
Bye
Hookahey
Hi I added a small feature to the plasmoid. It adds an inertial momentum to the temperature change. My CPU temperature oscillates between two values when idle (50-51°) and it is rather distracting to see the plasmoid reflect these changes. Now it will only display a change if there is a bigger difference (3°). This code snippet should be added to the init() function: Quote:
...
self.resetTimer = QtCore.QTimer()
self.resetTimer.setInterval(30000)
self.resetTimer.start()
QtCore.QObject.connect(self.resetTimer, QtCore.SIGNAL("timeout()"), self.resetOldTemp)
self.resetOldTemp()
self.timer = QtCore.QTimer()
self.timer.setInterval(2000)
self.timer.start()
QtCore.QObject.connect(self.timer, QtCore.SIGNAL("timeout()"), self.updateLabel)
self.updateLabel()
Also add the following snippet after the retrieval of the temperature in updateLabel():
Quote:
...
if (abs(t - self.oldTemp) > 3):
self.oldTemp = t
else:
t = self.oldTemp
...
and before setting the label text. One would have to experiment a bit with the threshold value but 3° seems to produce good results. The second timer used above is there to force showing the real temperature value if for a longer time (30s) there was no change otherwise the shown value can be off by +-2 and stay there. That's what the function below is needed for:
Quote:
def resetOldTemp(self):
self.oldTemp = 0
Bye
Hookahey
Hi there I made a great Nvidia temp sensor out of this :-) i just replaced: sensor = commands.getoutput("sensors | grep temp2"); sensor = sensor[sensor.find("+")+1:sensor.find("C")-2]; with this: sensor = commands.getoutput("nvidia-settings -q gpucoretemp | grep '0.0' | awk '{print $4 0}'"); and set class: class GPUTemp(plasmascript.Applet): and: return GPUTemp(parent) Works great thanx for the nice code
could you make a simple cpu meter for plasmoid
probably yes. if you describe what definitely you mean.
http://kde-look.org/content/show.php/Simple+CPU+Meter?content=140181 try this one.
Hi, I can´t install this plasmoid: Quote:plasmapkg -i ./reinstall.sh
plasmapkg(3294)/libplasma Plasma::PackageStructure::metadata: Could not open package file, unsupported archive format: "/home/kzkggaara/Downloads/simple-cpu-sensor/reinstall.sh" "application/x-shellscript"
KCrash: Application 'plasmapkg' crashing...
KCrash: Attempting to start /usr/lib/kde4/libexec/drkonqi from kdeinit
sock_file=/home/kzkggaara/.kde4/socket-exia/kdeinit4__0
Hm, reinstall.sh usefull only in case of reinstallation. cd into plasmoid directory and run ./reinstall.sh Or you can do it manually (just look at the code of this script). Btw, re-read INSTALLATION steps in description. Thanks for response.
also "plasmapkg -i ./reinstall.sh" if not a correct command. "./reinstall.sh" this is right one. Run it only if you have plasmoid installed.
Yeah, this fix my issue :) Thanks PS: Sorry for my english ;)
Plasmoid doesn't work with 2.6.37 and 2.6.38 kernels. I think path is changed to /sys/class somewhere. I am not sure though.
Changes for new kernel and fan support (paths prob differ for you): nano ~/.kde4/share/apps/plasma/plasmoids/simple-cpu-sensor/contents/code/main.py