diff options
author | Ken Moore <ken@pcbsd.org> | 2015-06-15 11:46:46 -0400 |
---|---|---|
committer | Ken Moore <ken@pcbsd.org> | 2015-06-15 11:46:46 -0400 |
commit | 9bc78c74a9a1f1627a71aca823423a91e14dbcd1 (patch) | |
tree | 008936cc78f683d1066d09f65f0f3738d8aba1cf /libLumina | |
parent | Disable some debugging and fix up the context menu on the applauncher plugins. (diff) | |
parent | Merge pull request #128 from Nanolx/master (diff) | |
download | lumina-9bc78c74a9a1f1627a71aca823423a91e14dbcd1.tar.gz lumina-9bc78c74a9a1f1627a71aca823423a91e14dbcd1.tar.bz2 lumina-9bc78c74a9a1f1627a71aca823423a91e14dbcd1.zip |
Merge branch 'master' of github.com:pcbsd/lumina
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 |