Wait for the terminal resize before the first screensaver effect

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
David Heinemeier Hansson
2026-08-10 13:59:20 +02:00
co-authored by Claude Opus 5
parent 4cc14933a4
commit 354c2f0060
+13
View File
@@ -22,6 +22,19 @@ hyprctl eval 'hl.config({ cursor = { invisible = true } })' &>/dev/null || hyprc
tty=$(tty 2>/dev/null) tty=$(tty 2>/dev/null)
# Terminals allocate the pty at the default 80x24 and only resize it once the
# compositor has told the window how big it is. ttfx measures the terminal once,
# at startup, so starting it before the resize lands sizes an 80x24 canvas and
# paints it into the corner of a fullscreen window.
wait_for_terminal_resize() {
local deadline=$((SECONDS + 2))
while ((SECONDS < deadline)) && [[ $(stty size 2>/dev/null) == "24 80" ]]; do
sleep 0.02
done
}
wait_for_terminal_resize
while true; do while true; do
ttfx -i ~/.config/omarchy/branding/screensaver.txt \ ttfx -i ~/.config/omarchy/branding/screensaver.txt \
--frame-rate 120 --canvas-width 0 --canvas-height 0 --reuse-canvas --anchor-canvas c --anchor-text c\ --frame-rate 120 --canvas-width 0 --canvas-height 0 --reuse-canvas --anchor-canvas c --anchor-text c\