From 8452cb649b3a434b72f14618297e095ac3b88355 Mon Sep 17 00:00:00 2001 From: Christopher Roy Bratusek Date: Fri, 12 Jun 2015 19:10:25 +0200 Subject: Debian updates: - display 'Not available' if cpu temp can not be read - add support for disk i/o in system monitor - update luminaDesktop.conf to new format --- libLumina/LuminaOS-Debian.cpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'libLumina') diff --git a/libLumina/LuminaOS-Debian.cpp b/libLumina/LuminaOS-Debian.cpp index 82374fed..df91819e 100644 --- a/libLumina/LuminaOS-Debian.cpp +++ b/libLumina/LuminaOS-Debian.cpp @@ -244,7 +244,9 @@ QStringList LOS::CPUTemperatures(){ //Returns: List containing the temperature o temp.removeAt(i); i--; } } - qDebug() << "teperatures" << temp; + if(temp.isEmpty()) { + temp << "Not available"; + } return temp; } @@ -270,6 +272,22 @@ int LOS::MemoryUsagePercent(){ } QStringList LOS::DiskUsage(){ //Returns: List of current read/write stats for each device - return QStringList(); //not implemented yet + QStringList info = LUtils::getCmdOutput("iostat -dx -N"); + if(info.length()<3){ return QStringList(); } //nothing from command + QStringList labs = info[1].split(" ",QString::SkipEmptyParts); + QStringList out; + QString fmt = "%1: %2 %3"; + for(int i=2; i2 && labs.length()>2){ + out << fmt.arg(data[0], data[3]+" "+labs[3], data[4]+" "+labs[4]); + } + } + } + + return out; } #endif -- cgit