aboutsummaryrefslogtreecommitdiff
path: root/libLumina
diff options
context:
space:
mode:
authorKen Moore <moorekou@gmail.com>2015-04-23 15:31:21 -0400
committerKen Moore <moorekou@gmail.com>2015-04-23 15:31:21 -0400
commit5853d24e0daa72fbaf8a349ff09ce22a39f542c4 (patch)
treee4a1c22898b7a648fdb8b6e48ce9ec06c32b80c4 /libLumina
parentRe-arrange the startup procedures a bit: (diff)
parentnew snapshot (diff)
downloadlumina-5853d24e0daa72fbaf8a349ff09ce22a39f542c4.tar.gz
lumina-5853d24e0daa72fbaf8a349ff09ce22a39f542c4.tar.bz2
lumina-5853d24e0daa72fbaf8a349ff09ce22a39f542c4.zip
Merge pull request #96 from Nanolx/master
Debian: reboot, shutdown and suspend
Diffstat (limited to 'libLumina')
-rw-r--r--libLumina/LuminaOS-Debian.cpp21
1 files changed, 15 insertions, 6 deletions
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