From 343a948ffc4b02bd0c6b9bc18fb3ea74fbe84c04 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 2 Aug 2025 13:37:00 +0200 Subject: [PATCH] Simplify error checking --- bin/omarchy-cmd-screensaver | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/bin/omarchy-cmd-screensaver b/bin/omarchy-cmd-screensaver index 0689c6a4..30afe769 100755 --- a/bin/omarchy-cmd-screensaver +++ b/bin/omarchy-cmd-screensaver @@ -2,22 +2,14 @@ trap "exit" SIGINT -screensaver() { +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" 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 \ No newline at end of file + gum spin --title "Can't find tte. Try: pip install terminaltexteffects" -- sleep 2 +fi +