diff --git a/man/logind.conf.xml b/man/logind.conf.xml
index 3045c1b9ba..fc838abee2 100644
--- a/man/logind.conf.xml
+++ b/man/logind.conf.xml
@@ -205,47 +205,34 @@
HandleLidSwitchExternalPower=
HandleLidSwitchDocked=
- Controls how logind shall handle the
- system power, reboot and sleep keys and the lid switch to trigger
- actions such as system power-off, reboot or suspend. Can be one of
- ignore,
- poweroff,
- reboot,
- halt,
- kexec,
- suspend,
- hibernate,
- hybrid-sleep,
- suspend-then-hibernate,
- lock, and
- factory-reset.
- If ignore, logind will never handle these
- keys. If lock, all running sessions will be
- screen-locked; otherwise, the specified action will be taken
- in the respective event. Only input devices with the
- power-switch udev tag will be watched for
- key/lid switch events. HandlePowerKey=
- defaults to poweroff, HandleRebootKey=
- defaults to reboot, HandleSuspendKey=
- defaults to suspend, HandleHibernateKey=
- defaults to hibernate, HandlePowerKeyLongPress=
- defaults to ignore, HandleRebootKeyLongPress=
- defaults to poweroff, HandleSuspendKeyLongPress=
- defaults to hibernate, HandleHibernateKeyLongPress=
- defaults to ignore.
- HandleLidSwitch= defaults to
- suspend.
- HandleLidSwitchExternalPower= is completely
- ignored by default (for backwards compatibility) — an explicit
- value must be set before it will be used to determine
- behaviour. HandleLidSwitchDocked= defaults
- to ignore. If the system is inserted in a
- docking station, or if more than one display is connected, the
- action specified by HandleLidSwitchDocked=
- occurs; if the system is on external power the action (if any)
- specified by HandleLidSwitchExternalPower=
- occurs; otherwise the HandleLidSwitch=
- action occurs.
+ Controls how logind shall handle the system power, reboot and sleep keys and the lid
+ switch to trigger actions such as system power-off, reboot or suspend. Can be one of
+ ignore, poweroff, reboot,
+ halt, kexec, suspend,
+ hibernate, hybrid-sleep,
+ suspend-then-hibernate, lock, and
+ factory-reset. If ignore, systemd-logind
+ will never handle these keys. If lock, all running sessions will be screen-locked;
+ otherwise, the specified action will be taken in the respective event. Only input devices with the
+ power-switch udev tag will be watched for key/lid switch
+ events.
+
+ HandlePowerKey= defaults to poweroff,
+ HandleRebootKey= defaults to reboot,
+ HandleSuspendKey= defaults to suspend,
+ HandleHibernateKey= defaults to hibernate,
+ HandlePowerKeyLongPress= defaults to ignore,
+ HandleRebootKeyLongPress= defaults to poweroff,
+ HandleSuspendKeyLongPress= defaults to hibernate,
+ HandleHibernateKeyLongPress= defaults to ignore.
+ HandleLidSwitch= defaults to suspend.
+ HandleLidSwitchExternalPower= is completely ignored by default (for backwards
+ compatibility) — an explicit value must be set before it will be used to determine
+ behaviour. HandleLidSwitchDocked= defaults to ignore. If the
+ system is inserted in a docking station, or if more than one display is connected, the action
+ specified by HandleLidSwitchDocked= occurs; if the system is on external power the
+ action (if any) specified by HandleLidSwitchExternalPower= occurs; otherwise the
+ HandleLidSwitch= action occurs.
A different application may disable logind's handling of system power and
sleep keys and the lid switch by taking a low-level inhibitor lock
diff --git a/man/org.freedesktop.login1.xml b/man/org.freedesktop.login1.xml
index d25287b18b..8fc145d771 100644
--- a/man/org.freedesktop.login1.xml
+++ b/man/org.freedesktop.login1.xml
@@ -194,10 +194,20 @@ node /org/freedesktop/login1 {
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s HandlePowerKey = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
+ readonly s HandlePowerKeyLongPress = '...';
+ @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
+ readonly s HandleRebootKey = '...';
+ @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
+ readonly s HandleRebootKeyLongPress = '...';
+ @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s HandleSuspendKey = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
+ readonly s HandleSuspendKeyLongPress = '...';
+ @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s HandleHibernateKey = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
+ readonly s HandleHibernateKeyLongPress = '...';
+ @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s HandleLidSwitch = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s HandleLidSwitchExternalPower = '...';
@@ -242,6 +252,16 @@ node /org/freedesktop/login1 {
};
+
+
+
+
+
+
+
+
+
+
@@ -418,10 +438,20 @@ node /org/freedesktop/login1 {
+
+
+
+
+
+
+
+
+
+
diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c
index 1212a1ac53..a9da1e7731 100644
--- a/src/login/logind-dbus.c
+++ b/src/login/logind-dbus.c
@@ -3378,8 +3378,13 @@ static const sd_bus_vtable manager_vtable[] = {
SD_BUS_PROPERTY("InhibitDelayMaxUSec", "t", NULL, offsetof(Manager, inhibit_delay_max), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("UserStopDelayUSec", "t", NULL, offsetof(Manager, user_stop_delay), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("HandlePowerKey", "s", property_get_handle_action, offsetof(Manager, handle_power_key), SD_BUS_VTABLE_PROPERTY_CONST),
+ SD_BUS_PROPERTY("HandlePowerKeyLongPress", "s", property_get_handle_action, offsetof(Manager, handle_power_key_long_press), SD_BUS_VTABLE_PROPERTY_CONST),
+ SD_BUS_PROPERTY("HandleRebootKey", "s", property_get_handle_action, offsetof(Manager, handle_reboot_key), SD_BUS_VTABLE_PROPERTY_CONST),
+ SD_BUS_PROPERTY("HandleRebootKeyLongPress", "s", property_get_handle_action, offsetof(Manager, handle_reboot_key_long_press), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("HandleSuspendKey", "s", property_get_handle_action, offsetof(Manager, handle_suspend_key), SD_BUS_VTABLE_PROPERTY_CONST),
+ SD_BUS_PROPERTY("HandleSuspendKeyLongPress", "s", property_get_handle_action, offsetof(Manager, handle_suspend_key_long_press), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("HandleHibernateKey", "s", property_get_handle_action, offsetof(Manager, handle_hibernate_key), SD_BUS_VTABLE_PROPERTY_CONST),
+ SD_BUS_PROPERTY("HandleHibernateKeyLongPress", "s", property_get_handle_action, offsetof(Manager, handle_hibernate_key_long_press), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("HandleLidSwitch", "s", property_get_handle_action, offsetof(Manager, handle_lid_switch), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("HandleLidSwitchExternalPower", "s", property_get_handle_action, offsetof(Manager, handle_lid_switch_ep), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("HandleLidSwitchDocked", "s", property_get_handle_action, offsetof(Manager, handle_lid_switch_docked), SD_BUS_VTABLE_PROPERTY_CONST),
diff --git a/src/login/logind.conf.in b/src/login/logind.conf.in
index 926bd6cfe9..8ec979e0e8 100644
--- a/src/login/logind.conf.in
+++ b/src/login/logind.conf.in
@@ -23,13 +23,16 @@
#InhibitDelayMaxSec=5
#UserStopDelaySec=10
#HandlePowerKey=poweroff
+#HandlePowerKeyLongPress=ignore
+#HandleRebootKey=reboot
+#HandleRebootKeyLongPress=poweroff
#HandleSuspendKey=suspend
+#HandleSuspendKeyLongPress=hibernate
#HandleHibernateKey=hibernate
+#HandleHibernateKeyLongPress=ignore
#HandleLidSwitch=suspend
#HandleLidSwitchExternalPower=suspend
#HandleLidSwitchDocked=ignore
-#HandleRebootKey=reboot
-#HandleRebootKeyLongPress=poweroff
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no