diff options
author | Ken Moore <moorekou@gmail.com> | 2015-06-12 15:32:08 -0400 |
---|---|---|
committer | Ken Moore <moorekou@gmail.com> | 2015-06-12 15:32:08 -0400 |
commit | 418d6fd165f13792d047504a3275b44dc75c72db (patch) | |
tree | ade4089fb00218aa80d8e84de0b1c3a935ff2ab2 /libLumina | |
parent | Add a QtQuick sample plugin and disable the new panel container for QtQuick p... (diff) | |
parent | Debian updates: (diff) | |
download | lumina-418d6fd165f13792d047504a3275b44dc75c72db.tar.gz lumina-418d6fd165f13792d047504a3275b44dc75c72db.tar.bz2 lumina-418d6fd165f13792d047504a3275b44dc75c72db.zip |
Merge pull request #128 from Nanolx/master
Debian updates
Diffstat (limited to 'libLumina')
-rw-r--r-- | libLumina/LuminaOS-Debian.cpp | 22 |
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 |