mirror of
https://github.com/basecamp/omarchy.git
synced 2025-08-03 15:19:24 +00:00
Allow any key to stop the screensaver
This commit is contained in:
@ -1,13 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
trap "exit" SIGINT
|
||||
|
||||
if command -v tte &>/dev/null; then
|
||||
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"
|
||||
"$effect" &
|
||||
|
||||
while pgrep tte >/dev/null; do
|
||||
if read -n 1 -t 0.01; then
|
||||
pkill tte 2>/dev/null
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
done
|
||||
else
|
||||
gum spin --title "Can't find tte. Try: pip install terminaltexteffects" -- sleep 2
|
||||
|
Reference in New Issue
Block a user