mirror of
https://github.com/basecamp/omarchy.git
synced 2025-08-02 14:59:23 +00:00
Try to protect the screensaver from missing tte or pip
This commit is contained in:
@ -2,9 +2,22 @@
|
|||||||
|
|
||||||
trap "exit" SIGINT
|
trap "exit" SIGINT
|
||||||
|
|
||||||
while true; do
|
screensaver() {
|
||||||
effect=$(tte 2>&1 | grep -oP '{\K[^}]+' | tr ',' ' ' | tr ' ' '\n' | sed -n '/^beams$/,$p' | sort -u | shuf -n1)
|
while true; do
|
||||||
tte -i ~/.local/share/omarchy/logo.txt \
|
effect=$(tte 2>&1 | grep -oP '{\K[^}]+' | tr ',' ' ' | tr ' ' '\n' | sed -n '/^beams$/,$p' | sort -u | shuf -n1)
|
||||||
--frame-rate 240 --canvas-width 0 --canvas-height 0 --anchor-canvas c --anchor-text c \
|
tte -i ~/.local/share/omarchy/logo.txt \
|
||||||
"$effect"
|
--frame-rate 240 --canvas-width 0 --canvas-height 0 --anchor-canvas c --anchor-text c \
|
||||||
done
|
"$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
|
||||||
|
Reference in New Issue
Block a user