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
-rw-r--r--libLumina/libLumina.pro14
9 files changed, 94 insertions, 1 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..c9874605 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(){
+ //This will only function on PC-BSD
+ //(permissions issues on standard FreeBSD unless setup a special way)
+ bool ok = QFile::exists("/usr/local/bin/pc-sysconfig");
+ if(ok){
+ ok = LUtils::getCmdOutput("pc-sysconfig systemcansuspend").join("").toLower().contains("true");
+ }
+ return ok;
+}
+
+//Put the system into the suspend state
+void LOS::systemSuspend(){
+ QProcess::startDetached("pc-sysconfig suspendsystem");
+}
+
//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();
diff --git a/libLumina/libLumina.pro b/libLumina/libLumina.pro
index 1b78367a..8da9598c 100644
--- a/libLumina/libLumina.pro
+++ b/libLumina/libLumina.pro
@@ -36,10 +36,22 @@ SOURCES += LuminaXDG.cpp \
LuminaOS-FreeBSD.cpp \
LuminaOS-DragonFly.cpp \
LuminaOS-OpenBSD.cpp \
- LuminaOS-Linux.cpp \
LuminaOS-kFreeBSD.cpp
# new OS support can be added here
+# check linux distribution and use specific
+# LuminaOS support functions (or fall back to
+# generic one
+
+LINUX_DISTRIBUTION = $$system(lsb_release -si)
+
+equals(LINUX_DISTRIBUTION, "Debian"): {
+ SOURCES += LuminaOS-Debian.cpp
+} else {
+ SOURCES += LuminaOS-Linux.cpp
+}
+
+
INCLUDEPATH += $$PREFIX/include
LIBS += -lX11 -lXrender -lXcomposite -lxcb -lxcb-ewmh -lxcb-icccm -lxcb-image -lxcb-composite
bgstack15