PoC use double fork to escape SIGSTOP
This commit is contained in:
parent
6652a581df
commit
b59ecc8aac
1 changed files with 7 additions and 1 deletions
|
@ -36,7 +36,13 @@ class Module(bumblebee.engine.Module):
|
||||||
try:
|
try:
|
||||||
if self._active:
|
if self._active:
|
||||||
self._xid = bumblebee.util.execute("xdotool search --class \"i3bar\"").strip()
|
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\"")
|
bumblebee.util.execute("notify-send \"Consuming caffeine\"")
|
||||||
else:
|
else:
|
||||||
for process in psutil.process_iter():
|
for process in psutil.process_iter():
|
||||||
|
|
Loading…
Reference in a new issue