Files
omarchy/bin/omarchy-cmd-screensaver
Ryan Hughes 8aa8d99d8d Prevent screensaver shifting up (#450)
Co-authored-by: David Heinemeier Hansson <david@hey.com>
2025-08-02 13:06:09 +02:00

23 lines
640 B
Bash
Executable File

#!/bin/bash
trap "exit" SIGINT
screensaver() {
while true; do
effect=$(tte 2>&1 | grep -oP '{\K[^}]+' | tr ',' ' ' | tr ' ' '\n' | sed -n '/^beams$/,$p' | sort -u | shuf -n1)
tte -i ~/.local/share/omarchy/logo.txt \
--frame-rate 240 --canvas-width 0 --canvas-height $(($(tput lines) - 2)) --anchor-canvas c --anchor-text c \
"$effect"
done
}
if command -v tte &>/dev/null; then
screensaver
else
if command -v pip &>/dev/null; then
pip install terminaltexteffects
screensaver
else
gum spin --title "Can't find tte or pip. Install pip, then try: pip install terminaltexteffects" -- sleep 2
fi
fi