Protect from AUR outage

This commit is contained in:
David Heinemeier Hansson 2025-08-24 18:00:23 +02:00
parent f0a77e65cd
commit a0c3a435fc

View File

@ -1,24 +1,28 @@
echo "Switch to Omarchy Chromium for synchronized theme switching" echo "Switch to Omarchy Chromium for synchronized theme switching"
set_theme_colors() { if omarchy-pkg-aur-accessible; then
if [[ -f ~/.config/omarchy/current/theme/chromium.theme ]] && command -v chromium &>/dev/null; then set_theme_colors() {
chromium --no-startup-window --set-theme-color="$(<~/.config/omarchy/current/theme/chromium.theme)" if [[ -f ~/.config/omarchy/current/theme/chromium.theme ]] && command -v chromium &>/dev/null; then
else chromium --no-startup-window --set-theme-color="$(<~/.config/omarchy/current/theme/chromium.theme)"
# Use a default, neutral grey if theme doesn't have a color else
chromium --no-startup-window --set-theme-color="28,32,39" # Use a default, neutral grey if theme doesn't have a color
fi chromium --no-startup-window --set-theme-color="28,32,39"
} fi
}
if command -v chromium &>/dev/null; then if command -v chromium &>/dev/null; then
sudo pacman -Rns --noconfirm chromium || true sudo pacman -Rns --noconfirm chromium || true
yay -Sy --noconfirm omarchy-chromium-bin yay -Sy --noconfirm omarchy-chromium-bin
if pgrep -x chromium; then if pgrep -x chromium; then
if gum confirm "Chromium must be restarted. Ready?"; then if gum confirm "Chromium must be restarted. Ready?"; then
pkill -x chromium pkill -x chromium
set_theme_colors
fi
else
set_theme_colors set_theme_colors
fi fi
else
set_theme_colors
fi fi
else
echo -e "\n\e[31mAUR is unavailable. Skipping installation. Please try manually later.\e[0m"
fi fi