From f90eb03e094642c23da5da519bdff2b52777bf7c Mon Sep 17 00:00:00 2001 From: Alexander Couzens Date: Mon, 11 Sep 2017 19:52:04 +0200 Subject: [PATCH] linux: allow Suspend as CriticalPowerAction When using UPower in a non-hybernate setup, the result of a CriticalPowerAction would be PowerOff. Certain users prefer Suspend instead, because this is the only way to recover graceful from that state. Suspend action will only used, when explicit configured. --- etc/UPower.conf | 2 ++ src/linux/up-backend.c | 1 + 2 files changed, 3 insertions(+) diff --git a/etc/UPower.conf b/etc/UPower.conf index e2c6a6987564..eb7de3f9145d 100644 --- a/etc/UPower.conf +++ b/etc/UPower.conf @@ -88,7 +88,9 @@ TimeAction=120 # PowerOff # Hibernate # HybridSleep +# Suspend # +# If Suspend isn't available, HybridSleep will be used # If HybridSleep isn't available, Hibernate will be used # If Hibernate isn't available, PowerOff will be used CriticalPowerAction=HybridSleep diff --git a/src/linux/up-backend.c b/src/linux/up-backend.c index e7684a2d26de..7b258e3901c5 100644 --- a/src/linux/up-backend.c +++ b/src/linux/up-backend.c @@ -392,6 +392,7 @@ up_backend_get_critical_action (UpBackend *backend) const gchar *method; const gchar *can_method; } actions[] = { + { "Suspend", "CanSuspend" }, { "HybridSleep", "CanHybridSleep" }, { "Hibernate", "CanHibernate" }, { "PowerOff", NULL }, -- 2.14.1