From 35b10394b68ce20ad14dde22f8ff27ba6a913c46 Mon Sep 17 00:00:00 2001 From: Matheus Oliveira Date: Sat, 30 Aug 2025 14:59:26 +0300 Subject: record: fix wf-recorder audio flag and proc error handling (#48) * fix(recording): Fix wf-recorder audio flag and improve process monitoring - Fix incorrect audio flag format for wf-recorder(Invalid whitespace) Changed from `-a ` to `--audio=` as per wf-recorder docs: "Specify device like this: -a or --audio=" - Add fallback to IDLE audio sources Audio sources are typically in IDLE state when no media is playing. Now falls back to IDLE sources if no RUNNING sources are found, ensuring audio capture works when recording starts during silence but media plays later. - Improve process startup monitoring The 0.1s sleep was insufficient for reliable process detection on NVIDIA systems. Process would start and immediately die ~90% of the time when triggered via keybinds. Now shows immediate UI feedback then monitors for 3 seconds to ensure stable process startup while maintaining responsive user experience. * check returncode + timeout 3s -> 1s + format --------- Co-authored-by: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> --- src/caelestia/utils/notify.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/caelestia/utils') diff --git a/src/caelestia/utils/notify.py b/src/caelestia/utils/notify.py index ad1ef33..ee86236 100644 --- a/src/caelestia/utils/notify.py +++ b/src/caelestia/utils/notify.py @@ -3,3 +3,18 @@ import subprocess def notify(*args: list[str]) -> str: return subprocess.check_output(["notify-send", "-a", "caelestia-cli", *args], text=True).strip() + + +def close_notification(id: str) -> None: + subprocess.run( + [ + "gdbus", + "call", + "--session", + "--dest=org.freedesktop.Notifications", + "--object-path=/org/freedesktop/Notifications", + "--method=org.freedesktop.Notifications.CloseNotification", + id, + ], + stdout=subprocess.DEVNULL, + ) -- cgit v1.2.3-freya