From a8ad8aadc39820594f89d43aa0f8d527b256aa99 Mon Sep 17 00:00:00 2001
From: Stefan Saraev <stefan@saraev.ca>
Date: Sat, 22 Mar 2014 13:40:55 +0200
Subject: [PATCH] disable suspend if /dev/.suspend_disabled exist

---
 src/shared/sleep-config.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/shared/sleep-config.c b/src/shared/sleep-config.c
index cf1cd40..f6ad307 100644
--- a/src/shared/sleep-config.c
+++ b/src/shared/sleep-config.c
@@ -256,6 +256,10 @@ int can_sleep(const char *verb) {
                streq(verb, "hibernate") ||
                streq(verb, "hybrid-sleep"));
 
+        // boo
+        if (access("/dev/.suspend_disabled", F_OK) == 0)
+                return false;
+
         r = parse_sleep_config(verb, &modes, &states);
         if (r < 0)
                 return false;
-- 
1.9.1

