From 2f66a8be6c312db0d36e70b43b8f15ad57a5b54f Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Wed, 10 Jun 2015 09:30:08 -0400 Subject: Adjust how the CPU/Temperature monitoring functions work on FreeBSD/PC-BSD. Now it will directly use the sysctls from the kernel instead of using an external monitoring utility. This makes it much more accurate and much faster --- libLumina/LuminaOS-FreeBSD.cpp | 84 +++++++++++++++++++++++++++++------------- 1 file changed, 59 insertions(+), 25 deletions(-) (limited to 'libLumina/LuminaOS-FreeBSD.cpp') diff --git a/libLumina/LuminaOS-FreeBSD.cpp b/libLumina/LuminaOS-FreeBSD.cpp index 290ddc11..96a7d9c2 100644 --- a/libLumina/LuminaOS-FreeBSD.cpp +++ b/libLumina/LuminaOS-FreeBSD.cpp @@ -1,12 +1,14 @@ //=========================================== // Lumina-DE source code -// Copyright (c) 2014, Ken Moore +// Copyright (c) 2014-2015, Ken Moore // Available under the 3-clause BSD license // See the LICENSE file for full details //=========================================== #ifdef __FreeBSD__ #include "LuminaOS.h" #include +#include +#include #include //can't read xbrightness settings - assume invalid until set @@ -256,35 +258,67 @@ QString LOS::FileSystemCapacity(QString dir) { //Return: percentage capacity as } QStringList LOS::CPUTemperatures(){ //Returns: List containing the temperature of any CPU's ("50C" for example) - QStringList temps = LUtils::getCmdOutput("sysctl -ai").filter(".temperature:"); - temps.sort(); - for(int i=0; i_count + //qDebug() << "Get Mem Usage"; QStringList mem = LUtils::getCmdOutput("top -n 0").filter("Mem: ", Qt::CaseInsensitive); if(mem.isEmpty()){ return -1; } @@ -297,10 +331,10 @@ int LOS::MemoryUsagePercent(){ if(mem[i].contains("Inact") || mem[i].contains("Free")){ fB = fB+LUtils::DisplaySizeToBytes(mem[i].section(" ",0,0)); } else{ uB = uB+LUtils::DisplaySizeToBytes(mem[i].section(" ",0,0)); } } - qDebug() << "Memory Calc:" << mem; - qDebug() << " - Bytes:" << "U:"<