refactor(services): split screen capture into screenshot + recorder services

Split the monolithic ScreenCapture service into focused Screenshot and
ScreenRecorder services behind a pluggable capture backend.

- Add shared/capture.py: CaptureBackend abstraction + HyprlandCaptureBackend
  (hyprshot/grim/slurp/wf-recorder) and reusable CaptureNotifier
- Add services/screenshot.py and services/screenrecorder.py with Fabric
  properties/signals; recording state kept in memory (no /tmp files)
- Keep services/screencapture.py as a backwards-compatible facade so
  existing widgets and signals keep working
- Resolve monitors via Hyprland IPC helpers in services/modus.py instead of
  spawning `hyprctl monitors -j` per capture
- Implement real window recording (slurp window boxes) and split the
  record-window / record-region UI mappings
- Register screenshot_service / screen_recorder_service singletons
- Remove dead src/utils/inhibit.py duplicate; minor modus.lua quoting fix
This commit is contained in:
sankalp committed 2026-07-13 23:52:32 +05:45
1 parent 54ff85ffc9
commit f3f17bb5fc
9 files changed
+1063 -566

No files matched your search

+6 -2
View File
@@ -219,7 +219,11 @@ class ScreenCaptureWindow(Window):
screen_capture_service.record(
"active", use_audio=use_audio, show_cursor=show_cursor
)
elif tool == "record-window" or tool == "record-region":
elif tool == "record-window":
screen_capture_service.record(
"window", use_audio=use_audio, show_cursor=show_cursor
)
elif tool == "record-region":
screen_capture_service.record(
"selection", use_audio=use_audio, show_cursor=show_cursor
)
@@ -323,7 +327,7 @@ class ScreenCaptureWindow(Window):
target_map = {
"region": "selection",
"fullscreen": "active",
"selectwindow": "selection",
"selectwindow": "window",
}
use_audio = (
self._options_menu.get_mic_enabled() if self._options_menu else False