Stop ttfx before closing the screensaver terminal (#6764)

This commit is contained in:
David Heinemeier Hansson
2026-08-12 20:05:10 +02:00
committed by GitHub
parent f5893ddd9e
commit 438f7b3340
2 changed files with 35 additions and 0 deletions
+1
View File
@@ -20,4 +20,5 @@ if pgrep -x "1password" >/dev/null && omarchy-cmd-present 1password; then
fi fi
# Avoid running screensaver when locked # Avoid running screensaver when locked
pkill -x ttfx 2>/dev/null || true
pkill -f '[o]rg.omarchy.screensaver' 2>/dev/null || true pkill -f '[o]rg.omarchy.screensaver' 2>/dev/null || true
+34
View File
@@ -0,0 +1,34 @@
#!/bin/bash
set -euo pipefail
source "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/base-test.sh"
tmpdir=$(mktemp -d)
trap 'rm -rf "$tmpdir"' EXIT
mock_bin="$tmpdir/bin"
call_log="$tmpdir/calls"
mkdir -p "$mock_bin"
for command in omarchy-shell hyprctl pkill; do
cat >"$mock_bin/$command" <<'SH'
#!/bin/bash
printf '%s %s\n' "$(basename "$0")" "$*" >>"$CALL_LOG"
SH
done
cat >"$mock_bin/pgrep" <<'SH'
#!/bin/bash
exit 1
SH
chmod +x "$mock_bin"/*
PATH="$mock_bin:$PATH" CALL_LOG="$call_log" "$ROOT/bin/omarchy-system-lock"
mapfile -t kills < <(rg '^pkill ' "$call_log")
[[ ${kills[0]} == "pkill -x ttfx" ]] ||
fail "system lock stops ttfx before closing its terminal" "calls: ${kills[*]}"
[[ ${kills[1]} == "pkill -f [o]rg.omarchy.screensaver" ]] ||
fail "system lock closes the screensaver terminal after ttfx" "calls: ${kills[*]}"
pass "system lock stops ttfx before closing its terminal"