
Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on git.opendesktop.org
The most AWESOME CPU sensor for KDE 4! For real people who likes simplicity!
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!
4 years ago
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
4 years ago
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
lexcher
Jan 10 2016
satch
May 13 2014
donpedro69
May 06 2014
warrob
Apr 21 2013
unIverse
Jun 30 2012
roctheme
Mar 14 2012
elric80
Mar 14 2012
pars1938
Dec 21 2011
freemanoid
Nov 09 2011
StrikeHoreges
Oct 27 2011
shatle
Oct 04 2011
Dratek
Oct 03 2011
zersaa
Sep 27 2011
floner123
Aug 24 2011
Djellel
Jul 06 2011
chazz557
Apr 15 2011
janet
Mar 26 2011
Genserowski
Mar 24 2011
zakaqere
Mar 22 2011
jeast
Mar 05 2011
wosk
Feb 20 2011
philafel
Feb 15 2011
riyad
Jan 03 2011
III
Dec 05 2010
dmd2live
Nov 26 2010
deabru
Nov 22 2010
vitoubien
Nov 22 2010
dreamsoul
Nov 22 2010
SeaJey
Nov 22 2010
schnelle
Nov 22 2010

lexcher
Jan 10 2016
unIverse
Jun 30 2012
parapente
Mar 11 2012
Genserowski
Mar 24 2011
linjac444
4 years ago
Report
warrob
5 years ago
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
Report
LoneWolf53
5 years ago
Love it's simplicity and there's nothing like it for GPU in KDE that I've noticed.
Report
alexoleshkevich
4 years ago
Report
gosom
6 years ago
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 :)
Report
elric80
6 years ago
updated the link a few hours ago, so it may be sthg else.
Thanks for this :)
Report
alexoleshkevich
6 years ago
Report
roctheme
6 years ago
Report
alexoleshkevich
6 years ago
Report
alexoleshkevich
6 years ago
Report
roctheme
6 years ago
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?
Report
alexoleshkevich
6 years ago
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"
Report
roctheme
6 years ago
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!
Report
Hookahey
7 years ago
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
Report
Hookahey
7 years ago
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
Report
vaxxipooh
7 years ago
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
Report
guzzorustyjoe
7 years ago
Report
alexoleshkevich
7 years ago
Report
alexoleshkevich
7 years ago
try this one.
Report
KZKG-Gaara
7 years ago
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
Report
alexoleshkevich
7 years ago
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.
Report
alexoleshkevich
7 years ago
"./reinstall.sh" this is right one.
Run it only if you have plasmoid installed.
Report
KZKG-Gaara
7 years ago
Thanks
PS: Sorry for my english ;)
Report
schnelle
7 years ago
Report
tcat
7 years ago
nano ~/.kde4/share/apps/plasma/plasmoids/simple-cpu-sensor/contents/code/main.py
def updateLabel(self):
color = 'blue'
fh = open('/sys/class/hwmon/hwmon1/device/temp1_input', 'r')
t = fh.read()
t = int(t)/1000
fh2 = open('/sys/class/hwmon/hwmon0/device/fan1_input', 'r')
f = fh2.read()
if(t > 75 and t < 80):
color = 'white'
elif(t > 80):
color = 'red'
else:
color = 'white'
self.label.setText('<font color="lightgray"><b>' + str(f) + ' RPM</b></font> <font color="' + color + '"><b>' + str(t) + "° C</b></font>")
Report