Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions bin/omarchy-capture-screenrecording
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,9 @@ stop_screenrecording() {
if omarchy-capture-screenrecording-process "${RECORDER[@]}"; then
omarchy-capture-screenrecording-process "${RECORDER[@]}" --signal KILL
omarchy-notification-send -u critical -t 5000 "$(omarchy-i18n capture.recordingError)" "$(omarchy-i18n capture.recordingKilled)"
elif [[ ! -f $(cat "$RECORDING_FILE" 2>/dev/null) ]]; then
# No recording to finalize or show, as when stopping a recorder this script did not start.
:
else
local filename=$(cat "$RECORDING_FILE" 2>/dev/null)
local preview="${filename%.mp4}-preview.png"
Expand Down
3 changes: 3 additions & 0 deletions test/shell.d/screenrecording-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,7 @@ legacy_runtime="$tmp_dir/legacy-runtime"
mkdir -p "$legacy_runtime"
touch "$recording_flag"
: >"$helper_calls"
rm -f "$OMARCHY_TEST_NOTIFICATION_ARGS"
XDG_RUNTIME_DIR="$legacy_runtime" OMARCHY_TEST_HELPER_CALLS="$helper_calls" OMARCHY_TEST_RECORDING="$recording_flag" \
OMARCHY_SCREENRECORD_DIR="$recording_dir" \
"$ROOT/bin/omarchy-capture-screenrecording" --stop-recording >/dev/null 2>&1 ||
Expand All @@ -517,6 +518,8 @@ grep -Fxq -- '--signal INT' "$helper_calls" ||
fail "stop signals the user's recorders when no pid was saved" "$(<"$helper_calls")"
! grep -Fq -- '--signal KILL' "$helper_calls" ||
fail "a recorder that stops on INT is not killed" "$(<"$helper_calls")"
[[ ! -e $OMARCHY_TEST_NOTIFICATION_ARGS ]] ||
fail "stop announces no saved recording when none was recorded as started" "$(<"$OMARCHY_TEST_NOTIFICATION_ARGS")"
pass "without a saved pid, status and stop select the user's recorders"

# The bar indicator and the menu's Stop row ask --status, so they show a stop
Expand Down
Loading