17 lines
395 B
C
17 lines
395 B
C
#include "dbus_wrapper.h"
|
|
|
|
bool suspend(void) {
|
|
const char *bus_name = "org.freedesktop.login1";
|
|
const char *path = "/org/freedesktop/login1";
|
|
const char *iface = "org.freedesktop.login1.Manager";
|
|
const char *method = "Suspend";
|
|
|
|
DBusConnection *conn = dbusConnect();
|
|
if (NULL == conn) {
|
|
return false;
|
|
}
|
|
|
|
dbusCallMethod(conn, bus_name, path, iface, method);
|
|
return true;
|
|
}
|