aboutsummaryrefslogtreecommitdiff
path: root/libLumina
diff options
context:
space:
mode:
Diffstat (limited to 'libLumina')
-rw-r--r--libLumina/LuminaOS-Debian.cpp3
-rw-r--r--libLumina/LuminaOS-DragonFly.cpp3
-rw-r--r--libLumina/LuminaOS-FreeBSD.cpp21
-rw-r--r--libLumina/LuminaOS-Linux.cpp4
-rw-r--r--libLumina/LuminaOS-OpenBSD.cpp4
-rw-r--r--libLumina/LuminaOS-kFreeBSD.cpp3
-rw-r--r--libLumina/LuminaOS-template.cpp3
-rw-r--r--libLumina/LuminaOS.h3
8 files changed, 43 insertions, 1 deletions
diff --git a/libLumina/LuminaOS-Debian.cpp b/libLumina/LuminaOS-Debian.cpp
index d1d5d344..82374fed 100644
--- a/libLumina/LuminaOS-Debian.cpp
+++ b/libLumina/LuminaOS-Debian.cpp
@@ -269,4 +269,7 @@ int LOS::MemoryUsagePercent(){
return qRound(per);
}
+QStringList LOS::DiskUsage(){ //Returns: List of current read/write stats for each device
+ return QStringList(); //not implemented yet
+}
#endif
diff --git a/libLumina/LuminaOS-DragonFly.cpp b/libLumina/LuminaOS-DragonFly.cpp
index dde24d0c..79f84e65 100644
--- a/libLumina/LuminaOS-DragonFly.cpp
+++ b/libLumina/LuminaOS-DragonFly.cpp
@@ -207,4 +207,7 @@ int LOS::MemoryUsagePercent(){
return -1; //not implemented yet
}
+QStringList LOS::DiskUsage(){ //Returns: List of current read/write stats for each device
+ return QStringList(); //not implemented yet
+}
#endif
diff --git a/libLumina/LuminaOS-FreeBSD.cpp b/libLumina/LuminaOS-FreeBSD.cpp
index ae394f38..fe001ab2 100644
--- a/libLumina/LuminaOS-FreeBSD.cpp
+++ b/libLumina/LuminaOS-FreeBSD.cpp
@@ -325,4 +325,25 @@ int LOS::MemoryUsagePercent(){
return qRound(perc);
}
+QStringList LOS::DiskUsage(){ //Returns: List of current read/write stats for each device
+ QStringList info = LUtils::getCmdOutput("iostat -dx -t IDE -t SCSI -t da");
+ 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(i==1){ 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
+ qDebug() << "Data Line:" << data;
+ if(data.length()>2 && labs.length()>2){
+ out << fmt.arg(data[0], data[1]+" "+labs[1], data[2]+" "+labs[2]);
+ }
+ }
+ }
+
+ return out;
+}
+
#endif
diff --git a/libLumina/LuminaOS-Linux.cpp b/libLumina/LuminaOS-Linux.cpp
index 2368f773..ebf49a08 100644
--- a/libLumina/LuminaOS-Linux.cpp
+++ b/libLumina/LuminaOS-Linux.cpp
@@ -235,4 +235,8 @@ int LOS::MemoryUsagePercent(){
return -1; //not implemented yet
}
+QStringList LOS::DiskUsage(){ //Returns: List of current read/write stats for each device
+ return QStringList(); //not implemented yet
+}
+
#endif
diff --git a/libLumina/LuminaOS-OpenBSD.cpp b/libLumina/LuminaOS-OpenBSD.cpp
index 10bb4e15..f33fed97 100644
--- a/libLumina/LuminaOS-OpenBSD.cpp
+++ b/libLumina/LuminaOS-OpenBSD.cpp
@@ -244,4 +244,8 @@ int LOS::MemoryUsagePercent(){
return -1; //not implemented yet
}
+QStringList LOS::DiskUsage(){ //Returns: List of current read/write stats for each device
+ return QStringList(); //not implemented yet
+}
+
#endif
diff --git a/libLumina/LuminaOS-kFreeBSD.cpp b/libLumina/LuminaOS-kFreeBSD.cpp
index 8954d685..91de843c 100644
--- a/libLumina/LuminaOS-kFreeBSD.cpp
+++ b/libLumina/LuminaOS-kFreeBSD.cpp
@@ -185,5 +185,8 @@ int LOS::MemoryUsagePercent(){
return -1; //not implemented yet
}
+QStringList LOS::DiskUsage(){ //Returns: List of current read/write stats for each device
+ return QStringList(); //not implemented yet
+}
#endif
#endif
diff --git a/libLumina/LuminaOS-template.cpp b/libLumina/LuminaOS-template.cpp
index eb233913..298f9ddd 100644
--- a/libLumina/LuminaOS-template.cpp
+++ b/libLumina/LuminaOS-template.cpp
@@ -133,4 +133,7 @@ int LOS::MemoryUsagePercent(){
return -1; //not implemented yet
}
+QStringList LOS::DiskUsage(){ //Returns: List of current read/write stats for each device
+ return QStringList(); //not implemented yet
+}
#endif
diff --git a/libLumina/LuminaOS.h b/libLumina/LuminaOS.h
index 738be5e4..2780c80c 100644
--- a/libLumina/LuminaOS.h
+++ b/libLumina/LuminaOS.h
@@ -1,6 +1,6 @@
//===========================================
// Lumina-DE source code
-// Copyright (c) 2014, Ken Moore
+// Copyright (c) 2014-15, Ken Moore
// Available under the 3-clause BSD license
// See the LICENSE file for full details
//===========================================
@@ -96,6 +96,7 @@ public:
static QStringList CPUTemperatures(); //Returns: List containing the temperature of any CPU's ("50C" for example)
static int CPUUsagePercent(); //Returns: Overall percentage of the amount of CPU cycles in use (-1 for errors)
static int MemoryUsagePercent(); //Returns: Overall percentage of the amount of available memory in use (-1 for errors)
+ static QStringList DiskUsage(); //Returns: List of current read/write stats for each device
};
#endif
bgstack15