refactor: extract reusable utils, remove screencapture facade
- Add ManagedTimer to replace repeated source_remove/timeout_add boilerplate - Add EvdevLockService base class for numlock/capslock (cut 154→28 lines) - Add BaseNotchIndicator for 5 near-identical indicator classes (cut 404→171 lines) - Add load_pixbuf_thumbnail and resolve_monitor to utils - Delete screencapture.py facade; callers use Screenshot/ScreenRecorder directly
This commit is contained in:
16 files changed
+401
-612
No files matched your search
@@ -418,6 +418,19 @@ def run_command(
|
||||
return CommandResult(1, "", str(e))
|
||||
|
||||
|
||||
def resolve_monitor(target: str) -> str | None:
|
||||
"""Resolve the ``"active"`` capture target to a concrete monitor name.
|
||||
|
||||
Returns ``None`` for non-active targets (the capture backend handles
|
||||
region/window/output directly).
|
||||
"""
|
||||
if target != "active":
|
||||
return None
|
||||
from services.modus import get_active_monitor_name
|
||||
|
||||
return get_active_monitor_name()
|
||||
|
||||
|
||||
def fuzzy_score(query: str, text: str) -> int:
|
||||
"""
|
||||
Fuzzy match scoring. Returns score > 0 if all query chars found in order.
|
||||
|
||||
Reference in new issue
Block a user