Screensaver: match upstream ttfx flow with static fallback; provision python-terminaltexteffects
swadhinbiswas committed 2 months ago
e4e67d2
1 parent 4b711d1
commit e4e67d2
2 files changed
+37 -2
Showing 2 changed files+37-2
▼bin/omarchy-screensaver
+30-1
| @@ -35,8 +35,37 @@ wait_for_terminal_resize() { | ||
35 | 35 | |
36 | 36 | wait_for_terminal_resize |
37 | 37 | |
38 | +# Branding art: the user's copy first, the shipped logo as fallback. Without | |
39 | +# an input file ttfx (or any renderer below) would error on every loop | |
40 | +# iteration, so bail out instead. | |
41 | +SCREENSAVER_INPUT="$HOME/.config/omarchy/branding/screensaver.txt" | |
42 | +[[ -f $SCREENSAVER_INPUT ]] || SCREENSAVER_INPUT="${OMARCHY_PATH:-/usr/share/de-omarchy}/logo.txt" | |
43 | + | |
44 | +# ttfx ships only in Omarchy's own pacman repo (not Arch/CachyOS repos, not | |
45 | +# the AUR), so a de-omarchy install may not have it. Render the branding art | |
46 | +# statically instead of looping on command-not-found forever. | |
47 | +run_static_screensaver() { | |
48 | + clear | |
49 | + cat "$SCREENSAVER_INPUT" | |
50 | + printf '\n\n (animated effects need ttfx — showing static art)\n' | |
51 | + while screensaver_in_focus; do | |
52 | + if read -n1 -t 1; then | |
53 | + exit_screensaver | |
54 | + fi | |
55 | + done | |
56 | + exit_screensaver | |
57 | +} | |
58 | + | |
59 | +if [[ ! -f $SCREENSAVER_INPUT ]]; then | |
60 | + exit_screensaver | |
61 | +fi | |
62 | + | |
63 | +if ! command -v ttfx >/dev/null 2>&1; then | |
64 | + run_static_screensaver | |
65 | +fi | |
66 | + | |
38 | 67 | while true; do |
39 | - ttfx -i ~/.config/omarchy/branding/screensaver.txt \ | |
68 | + ttfx -i "$SCREENSAVER_INPUT" \ | |
40 | 69 | --frame-rate 120 --canvas-width 0 --canvas-height 0 --reuse-canvas --anchor-canvas c --anchor-text c\ |
41 | 70 | --random-effect --no-eol --no-restore-cursor & |
42 | 71 | |
43 | 72 | |
▼packages/ui.packages
+7-1
| @@ -52,7 +52,7 @@ noto-fonts | ||
52 | 52 | noto-fonts-cjk |
53 | 53 | noto-fonts-emoji |
54 | 54 | woff2-font-awesome |
55 | -ttf-jetbrains-mono-nerd-basic | |
55 | +ttf-jetbrains-mono-nerd | |
56 | 56 | |
57 | 57 | # CLI helpers used by omarchy-* commands |
58 | 58 | jq |
| @@ -67,3 +67,9 @@ libnotify | ||
67 | 67 | python-gobject |
68 | 68 | lazydocker |
69 | 69 | papirus-icon-theme |
70 | +# XDG default-terminal spec implementation — Arch/CachyOS repos don't carry | |
71 | +# it; comes from the AUR (install.sh falls back to the AUR helper per-package). | |
72 | +xdg-terminal-exec | |
73 | +# ttfx — terminal-text-effects engine behind the animated Omarchy screensaver. | |
74 | +# Upstream ships it in Omarchy's own pacman repo; everywhere else it's AUR-only. | |
75 | +python-terminaltexteffects | |
70 | 76 | |