Simple CPU Sensor
KDE Plasma 4 Extensions
Score 74%
Description:

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!
Last changelog:

3 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



linjac444

2 years ago

Please add a sensor for GPU Temps. I have a NVIDIA

Report

warrob

4 years ago

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

Report

LoneWolf53

4 years ago

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.

Report

C

alexoleshkevich

3 years ago

If you provide me a way how to get a temperature for GPU, then a new widget will appear on this site.

Report

gosom

5 years ago

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) + '&deg; 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

5 years ago

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 :)

Report

C

alexoleshkevich

5 years ago

Sorry for that -- my bad ;) I reuploaded the correct plasmoid.

Report

roctheme

5 years ago

Try to download, but I get just the version 0.2!

Report

C

alexoleshkevich

5 years ago

hi, this actually 0.3 version but manifest was not updated. Fixed.

Report

C

alexoleshkevich

5 years ago

hi, this is 0.3 version actually but manifest.desktop was not updated. Fixed.

Report

roctheme

5 years ago

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?

Report

C

alexoleshkevich

5 years ago

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"

Report

roctheme

5 years ago

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!

Report

Hookahey

6 years ago

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

Report

Hookahey

6 years ago

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

Report

vaxxipooh

6 years ago

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

Report

guzzorustyjoe

6 years ago

could you make a simple cpu meter for plasmoid

Report

C

alexoleshkevich

6 years ago

probably yes. if you describe what definitely you mean.

Report

C

alexoleshkevich

6 years ago

http://kde-look.org/content/show.php/Simple+CPU+Meter?content=140181

try this one.

Report

KZKG-Gaara

6 years ago

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

Report

C

alexoleshkevich

6 years ago

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.

Report

C

alexoleshkevich

6 years ago

also "plasmapkg -i ./reinstall.sh" if not a correct command.

"./reinstall.sh" this is right one.

Run it only if you have plasmoid installed.

Report

KZKG-Gaara

6 years ago

Yeah, this fix my issue :)
Thanks

PS: Sorry for my english ;)

Report

schnelle

6 years ago

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.

Report

tcat

6 years ago

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

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>&nbsp;&nbsp;<font color="' + color + '"><b>' + str(t) + "&deg; C</b></font>")

Report

3 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



product-maker lexcher Jan 10 2016

product-maker satch May 13 2014

product-maker donpedro69 May 06 2014

product-maker warrob Apr 21 2013

product-maker unIverse Jun 30 2012

product-maker roctheme Mar 14 2012

product-maker elric80 Mar 14 2012

product-maker pars1938 Dec 21 2011

product-maker freemanoid Nov 09 2011

product-maker StrikeHoreges Oct 27 2011

product-maker shatle Oct 04 2011

product-maker Dratek Oct 03 2011

product-maker zersaa Sep 27 2011

product-maker floner123 Aug 24 2011

product-maker Djellel Jul 06 2011

product-maker chazz557 Apr 15 2011

product-maker janet Mar 26 2011

product-maker Genserowski Mar 24 2011

product-maker zakaqere Mar 22 2011

product-maker jeast Mar 05 2011

product-maker wosk Feb 20 2011

product-maker philafel Feb 15 2011

product-maker riyad Jan 03 2011

product-maker III Dec 05 2010

product-maker dmd2live Nov 26 2010

product-maker deabru Nov 22 2010

product-maker vitoubien Nov 22 2010

product-maker dreamsoul Nov 22 2010

product-maker SeaJey Nov 22 2010

product-maker schnelle Nov 22 2010

product-maker 6 6

File (click to download) Version Description Filetype Packagetype License Downloads Date Filesize OCS-Install DL
Details
version
1.1
updated May 13 2014
added Nov 22 2010
downloads today
0
page views today 1