install.sh: yay-compatible AUR flags, preserve theme on re-run, restart-shell guidance

swadhinbiswas committed 2 months ago
e6deb17
1 parent d6e0add
commit e6deb17
2 files changed
+39 -8
Showing 2 changed files+39-8
▼install.sh
+22-8
119
119
120
120
# Whatever remains is AUR-only: per package, with piped answers so
121
121
# prompts (provider selection etc.) never eat our package list.
122
+ # --skipreview is paru-specific; yay rejects unknown flags.
123
+ AUR_FLAGS=(-S --needed --noconfirm)
124
+ [[ $AUR_HELPER == paru ]] && AUR_FLAGS+=(--skipreview)
122
125
FAILED=""
123
126
for pkg in "${MISSING[@]}"; do
124
127
pacman -Qi "$pkg" >/dev/null 2>&1 && continue
125
128
if [[ -n $AUR_HELPER ]]; then
126
- printf '1\n1\n1\ny\n' | "$AUR_HELPER" -S --needed --noconfirm --skipreview "$pkg" \
127
- || FAILED+="$pkg "
129
+ log "Installing AUR package: $pkg ($AUR_HELPER)"
130
+ if (( ASSUME_YES )); then
131
+ "$AUR_HELPER" "${AUR_FLAGS[@]}" "$pkg" </dev/null || FAILED+="$pkg "
132
+ else
133
+ printf 'y\n' | "$AUR_HELPER" "${AUR_FLAGS[@]}" "$pkg" || FAILED+="$pkg "
134
+ fi
128
135
else
129
136
FAILED+="$pkg "
130
137
fi
288
295
bash "$REPO_DIR/scripts/migrate-host-binds.sh"
289
296
290
297
# ----------------------------------------------------------------------------
291
-# 8. Omarchy state init + default theme
298
+# 8. Omarchy state init + default theme (first install only)
292
299
# ----------------------------------------------------------------------------
293
-log "Initializing Omarchy state + rose-pine theme"
294
300
export OMARCHY_PATH=$RUNTIME
295
-mkdir -p "$HOME/.local/state/omarchy/current"
296
-"$RUNTIME/bin/omarchy-theme-set" rose-pine || warn "theme set failed (non-fatal; run 'omarchy theme set <name>' later)"
301
+if grep -q . "$HOME/.local/state/omarchy/current/theme.name" 2>/dev/null; then
302
+ log "Omarchy state already initialized — keeping theme '$(cat "$HOME/.local/state/omarchy/current/theme.name")'"
303
+else
304
+ log "Initializing Omarchy state + rose-pine theme"
305
+ mkdir -p "$HOME/.local/state/omarchy/current"
306
+ "$RUNTIME/bin/omarchy-theme-set" rose-pine || warn "theme set failed (non-fatal; run 'omarchy theme set <name>' later)"
307
+fi
297
308
298
309
unset OMARCHY_PATH
299
310
307
318
308
319
de-omarchy installed.
309
320
310
- Try it now (without logging out):
311
- source ~/.config/zshrc.d/50-de-omarchy.zsh
321
+ If your desktop was ALREADY running before this install, apply the new
322
+ runtime now (this picks up shell/QML changes too):
323
+ omarchy-restart-shell
312
324
hyprctl reload
313
325
314
326
Full experience after next login (env vars settle everywhere).
315
327
Themes: omarchy theme list | omarchy theme set "Tokyo Night"
316
328
Menu: SUPER + SHIFT + M (upstream's SUPER+SPACE stays yours)
329
+ Screensaver: idle for ~2.5 min — animated via ttfx if python-terminaltexteffects
330
+ installed; static art otherwise (see any warning above).
317
331
Revert: ./uninstall.sh (restores the exact pre-install state)
318
332
319
333
DONE
320
334
▼scripts/verify.sh
+17-0
50
50
&& ok "current theme: $(cat "$HOME/.local/state/omarchy/current/theme.name")" \
51
51
|| warn_no_theme=1
52
52
53
+# screensaver engine: ttfx is AUR-only; without it the screensaver falls back
54
+# to static art by design — warn (don't fail) with the exact fix.
55
+if [[ -f $RUNTIME/bin/omarchy-screensaver ]]; then
56
+ if command -v ttfx >/dev/null 2>&1; then
57
+ ok "screensaver: animated (ttfx found)"
58
+ else
59
+ echo " [warn] screensaver will be STATIC art — install the AUR package for animated:"
60
+ echo " paru -S python-terminaltexteffects"
61
+ fi
62
+fi
63
+
64
+# first-party bar widgets that must exist in the runtime
65
+for widget_dir in sysmon notification-center; do
66
+ [[ -d $RUNTIME/shell/plugins/$widget_dir || -f $RUNTIME/shell/plugins/bar/widgets/$widget_dir.qml ]] \
67
+ && ok "runtime plugin present: $widget_dir"
68
+done
69
+
53
70
# monitors sanity: live monitors match display/monitors.lua outputs
54
71
if command -v hyprctl >/dev/null 2>&1 && [[ -f $(dirname "${BASH_SOURCE[0]}")/../display/monitors.lua ]]; then
55
72
LIVE=$(hyprctl monitors all 2>/dev/null | grep -oP '^Monitor \K[^ ]+' | sort)
56
73