From 02c148a12a2da107a0957eb5315ef111ff849227 Mon Sep 17 00:00:00 2001 From: S4NKALP Date: Sun, 29 Jun 2025 11:23:54 +0545 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=85=20style(indicators,=20icons):=20up?= =?UTF-8?q?date=20screenrecord=20icon=20to=20F692=20for=20better=20consist?= =?UTF-8?q?ency?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/dock/components/indicators.py | 22 +++++++--------------- utils/icons.py | 3 +-- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/modules/dock/components/indicators.py b/modules/dock/components/indicators.py index 9340408..1c8c883 100644 --- a/modules/dock/components/indicators.py +++ b/modules/dock/components/indicators.py @@ -177,26 +177,19 @@ class RecordingIndicator(Button): def __init__(self, **kwargs): super().__init__(name="button-bar-recording", **kwargs) - # Path to the screen-capture script self.script_path = get_relative_path("../../../scripts/screen-capture.sh") self.recording_label = Label(name="recording-label", markup=icons.screenrecord) self.add(self.recording_label) - # Connect click to stop recording self.connect("clicked", self.on_stop_recording) - # Start with indicator hidden self.hide() - # Set up periodic checking for recording status self.check_recording_status() - self.timeout_id = GLib.timeout_add( - 1000, self.check_recording_status - ) # Check every second + self.timeout_id = GLib.timeout_add(1000, self.check_recording_status) def check_recording_status(self): - """Check if recording is currently active and update visibility.""" try: result = subprocess.run( [self.script_path, "status"], capture_output=True, text=True, timeout=2 @@ -219,15 +212,12 @@ class RecordingIndicator(Button): return True # Continue the timeout def on_stop_recording(self, *args): - """Stop the current recording.""" try: subprocess.Popen([self.script_path, "record", "stop"]) - # The indicator will hide automatically on next status check except Exception as e: print(f"Error stopping recording: {e}") def cleanup(self): - """Clean up the timeout when the indicator is destroyed.""" if hasattr(self, "timeout_id"): GLib.source_remove(self.timeout_id) @@ -241,14 +231,16 @@ class Indicators(Box): name="indicator", orientation="h" if not data.VERTICAL else "v", spacing=4, - children=[WifiIndicator(), BluetoothIndicator(), self.recording_indicator, - self.notifications - ], + children=[ + WifiIndicator(), + BluetoothIndicator(), + self.recording_indicator, + self.notifications, + ], **kwargs, ) self.show_all() def cleanup(self): - """Clean up all indicators when the dock is destroyed.""" if hasattr(self, "recording_indicator"): self.recording_indicator.cleanup() diff --git a/utils/icons.py b/utils/icons.py index d6e3bae..7cea415 100644 --- a/utils/icons.py +++ b/utils/icons.py @@ -21,7 +21,7 @@ ssfull: str = "" ssregion: str = "" sswindow: str = "" screenshots: str = "" -screenrecord: str = "" +screenrecord: str = "" recordings: str = "" ocr: str = "ﳃ" gamemode: str = "" @@ -187,7 +187,6 @@ auth: str = "" bookmark: str = "" star: str = "" process: str = "" -screentime: str = "" # otp