aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/changelog7
-rw-r--r--libLumina/LuminaOS-Debian.cpp21
2 files changed, 22 insertions, 6 deletions
diff --git a/debian/changelog b/debian/changelog
index bacb03b1..e3fa52c1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+lumina-desktop (0.8.4.556-1nano) unstable; urgency=low
+
+ * New git snapshot
+ * reboot, shutdown and suspend via logind
+
+ -- Christopher Roy Bratusek <nano@jpberlin.de> Thu, 23 Apr 2015 20:27:23 +0200
+
lumina-desktop (0.8.4.533-1nano) unstable; urgency=low
* New git snapshot
diff --git a/libLumina/LuminaOS-Debian.cpp b/libLumina/LuminaOS-Debian.cpp
index a7be653c..650a2b5a 100644
--- a/libLumina/LuminaOS-Debian.cpp
+++ b/libLumina/LuminaOS-Debian.cpp
@@ -100,7 +100,6 @@ QString info = LUtils::getCmdOutput("amixer get Master").join("").simplified();;
}
return out;
-
}
//Set the current volume
@@ -139,27 +138,37 @@ void LOS::startMixerUtility(){
//Check for user system permission (shutdown/restart)
bool LOS::userHasShutdownAccess(){
- return true; //not implemented yet
+ QProcess::startDetached("dbus-send --system --print-reply=literal \
+ --type=method_call --dest=org.freedesktop.login1 \
+ /org/freedesktop/login1 org.freedesktop.login1.Manager.CanPowerOff");
}
//System Shutdown
void LOS::systemShutdown(){ //start poweroff sequence
- QProcess::startDetached("shutdown -h now");
+ QProcess::startDetached("dbus-send --system --print-reply \
+ --dest=org.freedesktop.login1 /org/freedesktop/login1 \
+ org.freedesktop.login1.Manager.PowerOff boolean:true");
}
//System Restart
void LOS::systemRestart(){ //start reboot sequence
- QProcess::startDetached("shutdown -r now");
+ QProcess::startDetached("dbus-send --system --print-reply \
+ --dest=org.freedesktop.login1 /org/freedesktop/login1 \
+ org.freedesktop.login1.Manager.Reboot boolean:true");
}
//Check for suspend support
bool LOS::systemCanSuspend(){
- return false;
+ QProcess::startDetached("dbus-send --system --print-reply=literal \
+ --type=method_call --dest=org.freedesktop.login1 \
+ /org/freedesktop/login1 org.freedesktop.login1.Manager.CanSuspend");
}
//Put the system into the suspend state
void LOS::systemSuspend(){
-
+ QProcess::startDetached("dbus-send --system --print-reply \
+ --dest=org.freedesktop.login1 /org/freedesktop/login1 \
+ org.freedesktop.login1.Manager.Suspend boolean:true");
}
//Battery Availability
bgstack15