Sync from development - prepare for v0.5.0.4

This commit is contained in:
Omni
2026-03-29 15:46:37 +01:00
parent 8e4dd06f11
commit c3551cd269
55 changed files with 334 additions and 333 deletions

View File

@@ -8,6 +8,31 @@ import shutil
import logging
import threading
logger = logging.getLogger(__name__)
def suspend_baloo() -> bool:
"""Suspend KDE Baloo file indexer. Safe to call on non-KDE or headless systems."""
if not shutil.which("balooctl"):
return False
try:
subprocess.run(["balooctl", "suspend"], capture_output=True, timeout=5)
logger.debug("Baloo file indexer suspended")
return True
except Exception:
return False
def resume_baloo() -> None:
"""Resume KDE Baloo file indexer. No-op if balooctl is not present."""
if not shutil.which("balooctl"):
return
try:
subprocess.run(["balooctl", "resume"], capture_output=True, timeout=5)
logger.debug("Baloo file indexer resumed")
except Exception:
pass
def get_safe_python_executable():
"""
Get a safe Python executable for subprocess calls.