Extract background installation and do it all upfront

This commit is contained in:
David Heinemeier Hansson
2025-06-19 08:10:23 -04:00
parent ac1ac3011f
commit f45bdf5e46
7 changed files with 23 additions and 38 deletions

9
install/backgrounds.sh Normal file
View File

@ -0,0 +1,9 @@
BACKGROUNDS_DIR=~/.config/omarchy/backgrounds/
download_background_image() {
local url="$1"
local path="$2"
gum spin --title "Downloading background image..." -- curl -sL -o "$BACKGROUNDS_DIR/$path" "$url"
}
for t in ~/.local/share/omarchy/themes/*; do source "$t/backgrounds.sh"; done

View File

@ -1,6 +1,2 @@
BACKGROUNDS_DIR=~/.config/omarchy/backgrounds/catppuccin
if [[ ! -d $BACKGROUNDS_DIR ]]; then
mkdir -p $BACKGROUNDS_DIR
gum spin --title "Downloading background image..." -- curl -sL -o $BACKGROUNDS_DIR/1-catppuccin.png https://github.com/basecamp/omakub/raw/refs/heads/master/themes/catppuccin/background.png
fi
mkdir -p "$BACKGROUNDS_DIR/catppuccin"
download_background_image "https://github.com/basecamp/omakub/raw/refs/heads/master/themes/catppuccin/background.png", "catppuccin/1-catppuccin.png"

View File

@ -1,6 +1,2 @@
BACKGROUNDS_DIR=~/.config/omarchy/backgrounds/everforest
if [[ ! -d $BACKGROUNDS_DIR ]]; then
mkdir -p $BACKGROUNDS_DIR
gum spin --title "Downloading background image..." -- curl -sL -o $BACKGROUNDS_DIR/1-everforest.jpg https://github.com/basecamp/omakub/raw/refs/heads/master/themes/everforest/background.jpg
fi
mkdir -p "$BACKGROUNDS_DIR/everforest"
download_background_image "https://github.com/basecamp/omakub/raw/refs/heads/master/themes/everforest/background.jpg", "everforest/1-everforest.jpg"

View File

@ -1,6 +1,2 @@
BACKGROUNDS_DIR=~/.config/omarchy/backgrounds/gruvbox
if [[ ! -d $BACKGROUNDS_DIR ]]; then
mkdir -p $BACKGROUNDS_DIR
gum spin --title "Downloading background image..." -- curl -sL -o $BACKGROUNDS_DIR/1-gruvbox.jpg https://github.com/basecamp/omakub/raw/refs/heads/master/themes/gruvbox/background.jpg
fi
mkdir -p "$BACKGROUNDS_DIR/gruvbox"
download_background_image "https://github.com/basecamp/omakub/raw/refs/heads/master/themes/gruvbox/background.jpg", "gruvbox/1-grubox.jpg"

View File

@ -1,6 +1,2 @@
BACKGROUNDS_DIR=~/.config/omarchy/backgrounds/kanagawa
if [[ ! -d $BACKGROUNDS_DIR ]]; then
mkdir -p $BACKGROUNDS_DIR
gum spin --title "Downloading background image..." -- curl -sL -o $BACKGROUNDS_DIR/1-kanagawa.jpg https://github.com/basecamp/omakub/raw/refs/heads/master/themes/kanagawa/background.jpg
fi
mkdir -p "$BACKGROUNDS_DIR/kanagawa"
download_background_image "https://github.com/basecamp/omakub/raw/refs/heads/master/themes/kanagawa/background.jpg", "kanagawa/1-kanagawa.jpg"

View File

@ -1,6 +1,2 @@
BACKGROUNDS_DIR=~/.config/omarchy/backgrounds/nord
if [[ ! -d $BACKGROUNDS_DIR ]]; then
mkdir -p $BACKGROUNDS_DIR
gum spin --title "Downloading background image..." -- curl -sL -o $BACKGROUNDS_DIR/1-nord.png https://github.com/basecamp/omakub/raw/refs/heads/master/themes/nord/background.png
fi
mkdir -p "$BACKGROUNDS_DIR/nord"
download_background_image "https://github.com/basecamp/omakub/raw/refs/heads/master/themes/nord/background.png", "nord/1-nord.png"

View File

@ -1,8 +1,4 @@
BACKGROUNDS_DIR=~/.config/omarchy/backgrounds/tokyo-night
if [[ ! -d $BACKGROUNDS_DIR ]]; then
mkdir -p $BACKGROUNDS_DIR
gum spin --title "Downloading background image..." -- curl -sL -o $BACKGROUNDS_DIR/1-Milad-Fakurian-Abstract-Purple-Blue.jpg https://images.unsplash.com/photo-1620207418302-439b387441b0
gum spin --title "Downloading background image..." -- curl -sL -o $BACKGROUNDS_DIR/2-Pawel-Czerwinski-Abstract-Purple-Blue.jpg https://images.unsplash.com/photo-1651870364199-fc5f9f46ac85
gum spin --title "Downloading background image..." -- curl -sL -o $BACKGROUNDS_DIR/3-Jr-Korpa-Abstract-Purple-Blue.jpg https://images.unsplash.com/flagged/photo-1567400358593-9e6382752ea2
fi
mkdir -p "$BACKGROUNDS_DIR/tokyo-night"
download_background_image "https://images.unsplash.com/photo-1620207418302-439b387441b0", "tokyo-night/1-Milad-Fakurian-Abstract-Purple-Blue.jpg"
download_background_image "https://images.unsplash.com/photo-1651870364199-fc5f9f46ac85", "tokyo-night/2-Pawel-Czerwinski-Abstract-Purple-Blue.jpg"
download_background_image "https://images.unsplash.com/photo-1567400358593-9e6382752ea2", "tokyo-night/3-Jr-Korpa-Abstract-Purple-Blue.jpg"