omarchy/bin/omarchy-cmd-screensaver
Chris24680 0246468403
Allow customizing the screensaver logo (#863)
* check for custom screensaver logo or fall back to default

* move logo location to omarchy config folder

* fix missed location check

* add menu item to copy logo.txt and open in editor

* move to setup menu

* Just always use a user-editable screensaver.txt file

* No longer needed

* Be clearer

---------

Co-authored-by: Christopher Moore <cmoore@yozu.co.uk>
Co-authored-by: David Heinemeier Hansson <david@hey.com>
2025-08-22 15:11:02 +02:00

21 lines
662 B
Bash
Executable File

#!/bin/bash
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 ~/.config/omarchy/screensaver.txt \
--frame-rate 240 --canvas-width 0 --canvas-height $(($(tput lines) - 2)) --anchor-canvas c --anchor-text c \
"$effect" &
while pgrep -x tte >/dev/null; do
if read -n 1 -t 0.01; then
pkill -x tte 2>/dev/null
pkill -f "alacritty --class Screensaver" 2>/dev/null
exit 0
fi
done
done
else
gum spin --title "Can't find tte. Try: pip install terminaltexteffects" -- sleep 2
fi