From 9e8173ecedf4dda96387e07a208c75e09cc2f4e0 Mon Sep 17 00:00:00 2001 From: Scott Worley Date: Tue, 30 Sep 2025 20:35:32 -0700 Subject: [PATCH] Make GUI control for webcam sharing (It doesn't do anything yet) --- srec.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/srec.py b/srec.py index 7780e51..4a9d5b9 100644 --- a/srec.py +++ b/srec.py @@ -75,6 +75,14 @@ def make_button(label: str, action: Callable[[ return button +def make_share_control() -> Gtk.CheckButton: + can_share = os.path.exists('/sys/module/v4l2looback') + control = Gtk.CheckButton( + label='Share Webcam', sensitive=can_share, active=can_share) + control.set_margin_start(20) + return control + + def on_activate(app: Gtk.Application) -> None: win = Gtk.ApplicationWindow(application=app) win.set_title('SRec') @@ -87,6 +95,7 @@ def on_activate(app: Gtk.Application) -> None: screen = Gtk.CheckButton(label='Screen') nr_box.append(screen) nr_box.append(Gtk.CheckButton(label='Webcam', active=True, group=screen)) + nr_box.append(make_share_control()) nr_box.append(make_button("Start Recording", on_start_recording, stack)) stack.add_named(nr_box, "not_recording") -- 2.50.1