aboutsummaryrefslogtreecommitdiff
path: root/libLumina
diff options
context:
space:
mode:
authorChristopher Roy Bratusek <nano@jpberlin.de>2015-06-12 19:10:25 +0200
committerChristopher Roy Bratusek <nano@jpberlin.de>2015-06-12 19:10:25 +0200
commit8452cb649b3a434b72f14618297e095ac3b88355 (patch)
treeade4089fb00218aa80d8e84de0b1c3a935ff2ab2 /libLumina
parentAdd a QtQuick sample plugin and disable the new panel container for QtQuick p... (diff)
downloadlumina-8452cb649b3a434b72f14618297e095ac3b88355.tar.gz
lumina-8452cb649b3a434b72f14618297e095ac3b88355.tar.bz2
lumina-8452cb649b3a434b72f14618297e095ac3b88355.zip
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
Diffstat (limited to 'libLumina')
-rw-r--r--libLumina/LuminaOS-Debian.cpp22
1 files changed, 20 insertions, 2 deletions
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; i<info.length(); i++){ //skip the first two lines, just labels
+ info[i].replace("\t"," ");
+ if(info[i].startsWith("Device:")){ labs = info[i].split(" ", QString::SkipEmptyParts); }//the labels for each column
+ else{
+ QStringList data = info[i].split(" ",QString::SkipEmptyParts); //data[0] is always the device
+ if(data.length()>2 && labs.length()>2){
+ out << fmt.arg(data[0], data[3]+" "+labs[3], data[4]+" "+labs[4]);
+ }
+ }
+ }
+
+ return out;
}
#endif
bgstack15