summaryrefslogtreecommitdiff
path: root/src/up-daemon.c
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2020-06-17 17:44:12 +0200
committerBastien Nocera <hadess@hadess.net>2020-06-17 17:44:56 +0200
commitbe9357c67619550e12a3c959c33ebaae5b031617 (patch)
tree3e756ac1ceb8024ef6a4972033bf575cb5e0c456 /src/up-daemon.c
parent0a9c8458f272c0ca35f0b0ece08575a6fd6db4c9 (diff)
downloadupower-wip/hadess/low-power-mode.tar.gz
daemon: Add LowPowerMode togglewip/hadess/low-power-mode
Closes: #102
Diffstat (limited to 'src/up-daemon.c')
-rw-r--r--src/up-daemon.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/up-daemon.c b/src/up-daemon.c
index 5263c34..c4ae939 100644
--- a/src/up-daemon.c
+++ b/src/up-daemon.c
@@ -432,6 +432,19 @@ up_daemon_get_display_device (UpExportedDaemon *skeleton,
}
/**
+ * up_daemon_set_low_power_mode:
+ **/
+static gboolean
+up_daemon_set_low_power_mode (UpExportedDaemon *skeleton,
+ GDBusMethodInvocation *invocation,
+ UpDaemon *daemon)
+{
+ //FIXME verify that this gets blocked for users that aren't at the console
+ up_exported_daemon_complete_set_low_power_mode (skeleton, invocation);
+ return TRUE;
+}
+
+/**
* up_daemon_get_critical_action:
**/
static gboolean
@@ -1108,6 +1121,8 @@ up_daemon_init (UpDaemon *daemon)
G_CALLBACK (up_daemon_get_critical_action), daemon);
g_signal_connect (daemon, "handle-get-display-device",
G_CALLBACK (up_daemon_get_display_device), daemon);
+ g_signal_connect (daemon, "handle-set-low-power-mode",
+ G_CALLBACK (up_daemon_set_low_power_mode), daemon);
}
static const GDBusErrorEntry up_daemon_error_entries[] = {