summaryrefslogtreecommitdiff
path: root/src/login
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-10-22 13:02:50 +0200
committerLennart Poettering <lennart@poettering.net>2018-11-16 15:39:31 +0100
commit4e96eb682c187a08fb8560e89b27d46bc2b46223 (patch)
tree8fb6133a337457d7509587d6d5063aac00a8ed7c /src/login
parente455380b187aab1d02424d342d72c7cebb2d3bfb (diff)
downloadsystemd-4e96eb682c187a08fb8560e89b27d46bc2b46223.tar.gz
systemd-4e96eb682c187a08fb8560e89b27d46bc2b46223.tar.bz2
systemd-4e96eb682c187a08fb8560e89b27d46bc2b46223.zip
logind: also expose bool prop on bus that declares whether we are on external power
The three core variables that affect idleness handling are whether we are docked, whether we are on AC power and whether the lid is closed, hence let's also expose the third variable on the bus, to make things nicely debuggable.
Diffstat (limited to 'src/login')
-rw-r--r--src/login/logind-dbus.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c
index 273736290f..163fe04c1d 100644
--- a/src/login/logind-dbus.c
+++ b/src/login/logind-dbus.c
@@ -275,6 +275,7 @@ static int property_get_scheduled_shutdown(
static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_handle_action, handle_action, HandleAction);
static BUS_DEFINE_PROPERTY_GET(property_get_docked, "b", Manager, manager_is_docked_or_external_displays);
static BUS_DEFINE_PROPERTY_GET(property_get_lid_closed, "b", Manager, manager_is_lid_closed);
+static BUS_DEFINE_PROPERTY_GET_GLOBAL(property_get_on_external_power, "b", manager_is_on_external_power);
static BUS_DEFINE_PROPERTY_GET_GLOBAL(property_get_compat_user_tasks_max, "t", CGROUP_LIMIT_MAX);
static BUS_DEFINE_PROPERTY_GET_REF(property_get_hashmap_size, "t", Hashmap *, (uint64_t) hashmap_size);
@@ -2668,6 +2669,7 @@ const sd_bus_vtable manager_vtable[] = {
SD_BUS_PROPERTY("ScheduledShutdown", "(st)", property_get_scheduled_shutdown, 0, 0),
SD_BUS_PROPERTY("Docked", "b", property_get_docked, 0, 0),
SD_BUS_PROPERTY("LidClosed", "b", property_get_lid_closed, 0, 0),
+ SD_BUS_PROPERTY("OnExternalPower", "b", property_get_on_external_power, 0, 0),
SD_BUS_PROPERTY("RemoveIPC", "b", bus_property_get_bool, offsetof(Manager, remove_ipc), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("RuntimeDirectorySize", "t", NULL, offsetof(Manager, runtime_dir_size), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("InhibitorsMax", "t", NULL, offsetof(Manager, inhibitors_max), SD_BUS_VTABLE_PROPERTY_CONST),