aboutsummaryrefslogtreecommitdiff
path: root/libLumina
diff options
context:
space:
mode:
Diffstat (limited to 'libLumina')
-rw-r--r--libLumina/LuminaOS-Debian.cpp10
-rw-r--r--libLumina/LuminaOS-DragonFly.cpp10
-rw-r--r--libLumina/LuminaOS-FreeBSD.cpp16
-rw-r--r--libLumina/LuminaOS-Linux.cpp10
-rw-r--r--libLumina/LuminaOS-OpenBSD.cpp10
-rw-r--r--libLumina/LuminaOS-kFreeBSD.cpp10
-rw-r--r--libLumina/LuminaOS-template.cpp10
-rw-r--r--libLumina/LuminaOS.h5
8 files changed, 81 insertions, 0 deletions
diff --git a/libLumina/LuminaOS-Debian.cpp b/libLumina/LuminaOS-Debian.cpp
index 7ce8250f..a7be653c 100644
--- a/libLumina/LuminaOS-Debian.cpp
+++ b/libLumina/LuminaOS-Debian.cpp
@@ -152,6 +152,16 @@ void LOS::systemRestart(){ //start reboot sequence
QProcess::startDetached("shutdown -r now");
}
+//Check for suspend support
+bool LOS::systemCanSuspend(){
+ return false;
+}
+
+//Put the system into the suspend state
+void LOS::systemSuspend(){
+
+}
+
//Battery Availability
bool LOS::hasBattery(){
QString my_status = LUtils::getCmdOutput("acpi -b").join("");
diff --git a/libLumina/LuminaOS-DragonFly.cpp b/libLumina/LuminaOS-DragonFly.cpp
index b9ba58a2..57ff1b2a 100644
--- a/libLumina/LuminaOS-DragonFly.cpp
+++ b/libLumina/LuminaOS-DragonFly.cpp
@@ -148,6 +148,16 @@ void LOS::systemRestart(){ //start reboot sequence
QProcess::startDetached("shutdown -r now");
}
+//Check for suspend support
+bool LOS::systemCanSuspend(){
+ return false;
+}
+
+//Put the system into the suspend state
+void LOS::systemSuspend(){
+
+}
+
//Battery Availability
bool LOS::hasBattery(){
int val = LUtils::getCmdOutput("apm -l").join("").toInt();
diff --git a/libLumina/LuminaOS-FreeBSD.cpp b/libLumina/LuminaOS-FreeBSD.cpp
index 430a31fc..e294cf25 100644
--- a/libLumina/LuminaOS-FreeBSD.cpp
+++ b/libLumina/LuminaOS-FreeBSD.cpp
@@ -171,6 +171,22 @@ void LOS::systemRestart(){ //start reboot sequence
QProcess::startDetached("shutdown -ro now");
}
+//Check for suspend support
+bool LOS::systemCanSuspend(){
+ //Check the supported CPU sleep states and ensure that S3 is listed
+ QStringList info = LUtils::getCmdOutput("sysctl -ae").filter("hw.acpi.supported_sleep_state=");
+ bool ok = false;
+ if(!info.isEmpty()){
+ ok = info.first().section("=",1,1).split(" ").contains("S3");
+ }
+ return ok;
+}
+
+//Put the system into the suspend state
+void LOS::systemSuspend(){
+ LUtils::runCmd("acpiconf -s 3");
+}
+
//Battery Availability
bool LOS::hasBattery(){
int val = LUtils::getCmdOutput("apm -l").join("").toInt();
diff --git a/libLumina/LuminaOS-Linux.cpp b/libLumina/LuminaOS-Linux.cpp
index 46a6371a..6929c9c3 100644
--- a/libLumina/LuminaOS-Linux.cpp
+++ b/libLumina/LuminaOS-Linux.cpp
@@ -149,6 +149,16 @@ void LOS::systemRestart(){ //start reboot sequence
QProcess::startDetached("shutdown -r now");
}
+//Check for suspend support
+bool LOS::systemCanSuspend(){
+ return false;
+}
+
+//Put the system into the suspend state
+void LOS::systemSuspend(){
+
+}
+
//Battery Availability
bool LOS::hasBattery(){
QString my_status = LUtils::getCmdOutput("acpi -b").join("");
diff --git a/libLumina/LuminaOS-OpenBSD.cpp b/libLumina/LuminaOS-OpenBSD.cpp
index df6ddeba..5fda4866 100644
--- a/libLumina/LuminaOS-OpenBSD.cpp
+++ b/libLumina/LuminaOS-OpenBSD.cpp
@@ -166,6 +166,16 @@ void LOS::systemRestart(){ //start reboot sequence
QProcess::startDetached("shutdown -r now");
}
+//Check for suspend support
+bool LOS::systemCanSuspend(){
+ return false;
+}
+
+//Put the system into the suspend state
+void LOS::systemSuspend(){
+
+}
+
//Battery Availability
bool LOS::hasBattery(){
int val = LUtils::getCmdOutput("apm -b").join("").toInt();
diff --git a/libLumina/LuminaOS-kFreeBSD.cpp b/libLumina/LuminaOS-kFreeBSD.cpp
index 2b24ce51..dee5a6c8 100644
--- a/libLumina/LuminaOS-kFreeBSD.cpp
+++ b/libLumina/LuminaOS-kFreeBSD.cpp
@@ -133,6 +133,16 @@ void LOS::systemRestart(){ //start reboot sequence
QProcess::startDetached("shutdown -r now");
}
+//Check for suspend support
+bool LOS::systemCanSuspend(){
+ return false;
+}
+
+//Put the system into the suspend state
+void LOS::systemSuspend(){
+
+}
+
//Battery Availability
bool LOS::hasBattery(){
return false;
diff --git a/libLumina/LuminaOS-template.cpp b/libLumina/LuminaOS-template.cpp
index dfb9d850..aabd7da3 100644
--- a/libLumina/LuminaOS-template.cpp
+++ b/libLumina/LuminaOS-template.cpp
@@ -81,6 +81,16 @@ void LOS::systemRestart(){ //start reboot sequence
QProcess::startDetached("shutdown -r now");
}
+//Check for suspend support
+bool LOS::systemCanSuspend(){
+ return false;
+}
+
+//Put the system into the suspend state
+void LOS::systemSuspend(){
+
+}
+
//Battery Availability
bool LOS::hasBattery(){
return false; //not implemented yet
diff --git a/libLumina/LuminaOS.h b/libLumina/LuminaOS.h
index 091a8d96..eb0e2eb6 100644
--- a/libLumina/LuminaOS.h
+++ b/libLumina/LuminaOS.h
@@ -71,6 +71,11 @@ public:
static void systemShutdown(); //start poweroff sequence
//System Restart
static void systemRestart(); //start reboot sequence
+ //Check for suspend support
+ static bool systemCanSuspend();
+ //Put the system into the suspend state
+ static void systemSuspend();
+
//Battery Availability
static bool hasBattery();
bgstack15