refactor(spotlight): spawn caffeine detached

This commit is contained in:
sankalp committed 2026-08-02 13:37:10 +05:45
1 parent 4f2c3eb88c
commit 515c04d33c
1 file changed
+2 -3
+2 -3
View File
@@ -1,11 +1,10 @@
import os
import signal
import subprocess
from fabric.utils import logger
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
_PID_FILE = os.path.join(
@@ -114,7 +113,7 @@ class CaffeinePlugin(SpotlightPlugin):
str(seconds),
]
try:
proc = subprocess.Popen(cmd)
proc = spawn_detached(cmd)
except FileNotFoundError:
logger.error("[Caffeine] systemd-inhibit not found on this system")
return