Prepare for tte's imminent return!

This commit is contained in:
David Heinemeier Hansson 2025-08-24 22:24:42 +02:00
parent f14810e80d
commit 599b58f9a1
2 changed files with 17 additions and 14 deletions

View File

@ -1,18 +1,16 @@
#!/bin/bash #!/bin/bash
if command -v tte &>/dev/null; then while true; do
while true; do effect=$(tte 2>&1 | grep -oP '{\K[^}]+' | tr ',' ' ' | tr ' ' '\n' | sed -n '/^beams$/,$p' | sort -u | shuf -n1)
effect=$(tte 2>&1 | grep -oP '{\K[^}]+' | tr ',' ' ' | tr ' ' '\n' | sed -n '/^beams$/,$p' | sort -u | shuf -n1) tte -i ~/.config/omarchy/branding/screensaver.txt \
tte -i ~/.config/omarchy/branding/screensaver.txt \ --frame-rate 240 --canvas-width 0 --canvas-height $(($(tput lines) - 2)) --anchor-canvas c --anchor-text c \
--frame-rate 240 --canvas-width 0 --canvas-height $(($(tput lines) - 2)) --anchor-canvas c --anchor-text c \ "$effect" &
"$effect" &
while pgrep -x tte >/dev/null; do while pgrep -x tte >/dev/null; do
if read -n 1 -t 0.01; then if read -n 1 -t 0.01; then
pkill -x tte 2>/dev/null pkill -x tte 2>/dev/null
pkill -f "alacritty --class Screensaver" 2>/dev/null pkill -f "alacritty --class Screensaver" 2>/dev/null
exit 0 exit 0
fi fi
done
done done
fi done

View File

@ -1,5 +1,10 @@
#!/bin/bash #!/bin/bash
# Exit early if we don't have the tte show
if ! command -v tte &>/dev/null; then
exit 0
fi
# Exit early if screensave is already running # Exit early if screensave is already running
pgrep -f "alacritty --class Screensaver" && exit 0 pgrep -f "alacritty --class Screensaver" && exit 0