refactor(spotlight): spawn caffeine detached
This commit is contained in:
1 file changed
+2
-3
@@ -1,11 +1,10 @@
|
|||||||
import os
|
import os
|
||||||
import signal
|
import signal
|
||||||
import subprocess
|
|
||||||
|
|
||||||
from fabric.utils import logger
|
from fabric.utils import logger
|
||||||
|
|
||||||
from shared.capture import CaptureNotifier
|
from shared.capture import CaptureNotifier
|
||||||
from utils.functions import format_duration, parse_timeout_string
|
from utils.functions import format_duration, parse_timeout_string, spawn_detached
|
||||||
from window.spotlight.api import SearchResult, SpotlightPlugin
|
from window.spotlight.api import SearchResult, SpotlightPlugin
|
||||||
|
|
||||||
_PID_FILE = os.path.join(
|
_PID_FILE = os.path.join(
|
||||||
@@ -114,7 +113,7 @@ class CaffeinePlugin(SpotlightPlugin):
|
|||||||
str(seconds),
|
str(seconds),
|
||||||
]
|
]
|
||||||
try:
|
try:
|
||||||
proc = subprocess.Popen(cmd)
|
proc = spawn_detached(cmd)
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
logger.error("[Caffeine] systemd-inhibit not found on this system")
|
logger.error("[Caffeine] systemd-inhibit not found on this system")
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in new issue
Block a user