From 80bdcd360536433f37948c6ae09cdf96287b2279 Mon Sep 17 00:00:00 2001 From: Christopher Roy Bratusek Date: Fri, 22 May 2015 22:01:59 +0200 Subject: update Debian support - LOS::userHasShutdownAccess -- proper return [fix compiler warning] - LOS::systemCanSuspend -- proper return [fix compiler warning] - LOS::CPUTemperatures -- get cpu temp [XXX untested as my FX-8350 doesn't talk to me] - LOS::CPUUsagePercent -- get cpu usage - LOS::MemoryUsagePercent -- get memory usage --- libLumina/LuminaOS-Debian.cpp | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) (limited to 'libLumina') diff --git a/libLumina/LuminaOS-Debian.cpp b/libLumina/LuminaOS-Debian.cpp index e3aabeae..d1d5d344 100644 --- a/libLumina/LuminaOS-Debian.cpp +++ b/libLumina/LuminaOS-Debian.cpp @@ -138,7 +138,7 @@ void LOS::startMixerUtility(){ //Check for user system permission (shutdown/restart) bool LOS::userHasShutdownAccess(){ - QProcess::startDetached("dbus-send --system --print-reply=literal \ + return QProcess::startDetached("dbus-send --system --print-reply=literal \ --type=method_call --dest=org.freedesktop.login1 \ /org/freedesktop/login1 org.freedesktop.login1.Manager.CanPowerOff"); } @@ -159,7 +159,7 @@ void LOS::systemRestart(){ //start reboot sequence //Check for suspend support bool LOS::systemCanSuspend(){ - QProcess::startDetached("dbus-send --system --print-reply=literal \ + return QProcess::startDetached("dbus-send --system --print-reply=literal \ --type=method_call --dest=org.freedesktop.login1 \ /org/freedesktop/login1 org.freedesktop.login1.Manager.CanSuspend"); } @@ -236,15 +236,37 @@ QString LOS::FileSystemCapacity(QString dir) { //Return: percentage capacity as } QStringList LOS::CPUTemperatures(){ //Returns: List containing the temperature of any CPU's ("50C" for example) - return QStringList(); //not implemented yet + QStringList temp = LUtils::getCmdOutput("acpi -t").filter("degrees"); + for(int i=0; i