From b59ecc8aac71232186f234b8bf4669bbc18a64b0 Mon Sep 17 00:00:00 2001 From: mw Date: Wed, 28 Aug 2019 00:09:04 +0200 Subject: [PATCH] PoC use double fork to escape SIGSTOP --- bumblebee/modules/caffeine.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bumblebee/modules/caffeine.py b/bumblebee/modules/caffeine.py index 7b2e290..fa2876e 100644 --- a/bumblebee/modules/caffeine.py +++ b/bumblebee/modules/caffeine.py @@ -36,7 +36,13 @@ class Module(bumblebee.engine.Module): try: if self._active: self._xid = bumblebee.util.execute("xdotool search --class \"i3bar\"").strip() - bumblebee.util.execute("xdg-screensaver suspend {}".format(self._xid)) + pid = os.fork() + if pid == 0: + os.setsid() + bumblebee.util.execute("xdg-screensaver suspend {}".format(self._xid)) + os._exit(0) + else: + os.waitpid(pid,0) bumblebee.util.execute("notify-send \"Consuming caffeine\"") else: for process in psutil.process_iter():