Files
omarchy/bin/omarchy-cmd-screensaver
David Heinemeier Hansson 432ffb508c Themeing for ghostty (#1701)
* Themeing for ghostty

* Fix theme name

* Set font for ghostty too if its on the system

* Use correct class for ghostty styling

* Uniformity

* Need to keep this alacritty until we have it fully working for other terminals

* Stick to alacritty so we can control font size

* Stick with alacritty for system terminals

* Add menu to install different terminal

* Use taha approved colors
2025-09-16 21:31:40 +02:00

30 lines
811 B
Bash
Executable File

#!/bin/bash
screensaver_in_focus() {
hyprctl activewindow -j | jq -e '.class == "Screensaver"' >/dev/null 2>&1
}
exit_screensaver() {
hyprctl keyword cursor:invisible false
pkill -x tte 2>/dev/null
pkill -f "alacritty --class Screensaver" 2>/dev/null
exit 0
}
trap exit_screensaver SIGINT SIGTERM SIGHUP SIGQUIT
hyprctl keyword cursor:invisible true
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/branding/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 3 || ! screensaver_in_focus; then
exit_screensaver
fi
done
done