From c4f57beba214855aae38fac9b17b9d6e281630c9 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 8 Mar 2026 15:52:31 +0100 Subject: [PATCH] Show better with a preview notification that'll open recording on invocation --- bin/omarchy-cmd-screenrecord | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/bin/omarchy-cmd-screenrecord b/bin/omarchy-cmd-screenrecord index 3ee3d877..93e143a9 100755 --- a/bin/omarchy-cmd-screenrecord +++ b/bin/omarchy-cmd-screenrecord @@ -135,7 +135,17 @@ stop_screenrecording() { notify-send "Screen recording error" "Recording process had to be force-killed. Video may be corrupted." -u critical -t 5000 else trim_first_frame - notify-send "Screen recording saved to $OUTPUT_DIR" -t 2000 + local filename=$(cat "$RECORDING_FILE" 2>/dev/null) + local preview="${filename%.mp4}-preview.png" + + # Generate a preview thumbnail from the first frame + ffmpeg -y -i "$filename" -ss 00:00:00.1 -vframes 1 -q:v 2 "$preview" -loglevel quiet 2>/dev/null + + ( + ACTION=$(notify-send "Screen recording saved" "Open with Super + Alt + , (or click this)" -t 10000 -i "${preview:-$filename}" -A "default=open") + [[ $ACTION == "default" ]] && mpv "$filename" + rm -f "$preview" + ) & fi rm -f "$RECORDING_FILE"