-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathLogin1Manager.vala
More file actions
45 lines (38 loc) · 1.47 KB
/
Login1Manager.vala
File metadata and controls
45 lines (38 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
* SPDX-License-Identifier: GPL-3.0-or-later
* SPDX-FileCopyrightText: 2024-2026 elementary, Inc. (https://elementary.io)
*/
public class QuickSettings.Login1Manager : Object {
public struct UserInfo {
uint32 uid;
string user_name;
ObjectPath? user_object;
}
[DBus (name = "org.freedesktop.login1.Manager")]
public interface Login1ManagerInterface : Object {
public abstract void suspend (bool interactive) throws GLib.Error;
public abstract void reboot (bool interactive) throws GLib.Error;
public abstract void power_off (bool interactive) throws GLib.Error;
public abstract void reboot_with_flags (uint64 flags) throws GLib.Error;
public abstract void power_off_with_flags (uint64 flags) throws GLib.Error;
public abstract UserInfo[] list_users () throws GLib.Error;
public abstract string can_suspend () throws GLib.Error;
}
public Login1ManagerInterface proxy { get; private set; }
private static GLib.Once<Login1Manager> instance;
public static unowned Login1Manager get_default () {
return instance.once (() => new Login1Manager ());
}
private Login1Manager () {}
construct {
try {
proxy = Bus.get_proxy_sync<Login1ManagerInterface> (
SYSTEM,
"org.freedesktop.login1",
"/org/freedesktop/login1"
);
} catch (Error e) {
critical (e.message);
}
}
}