Make migrations faster to skip if they've already been run

This commit is contained in:
David Heinemeier Hansson
2025-07-20 17:36:29 -05:00
parent 5b3c324350
commit 9b8569e537
16 changed files with 67 additions and 45 deletions

View File

@ -1,4 +1,6 @@
echo "Fixing persistent workspaces in waybar config" echo "Fixing persistent workspaces in waybar config"
if [[ -f ~/.config/waybar/config ]]; then
sed -i 's/"persistent_workspaces":/"persistent-workspaces":/' ~/.config/waybar/config sed -i 's/"persistent_workspaces":/"persistent-workspaces":/' ~/.config/waybar/config
pkill waybar pkill -SIGUSR2 waybar
setsid waybar >/dev/null 2>&1 & fi

View File

@ -1,2 +1,5 @@
echo "Installing missing fd terminal tool for finding files" echo "Installing missing fd terminal tool for finding files"
if ! command -v fd &>/dev/null; then
yay -S --noconfirm --needed fd yay -S --noconfirm --needed fd
fi

View File

@ -1,2 +1,5 @@
echo "Add LocalSend as new default application" echo "Add LocalSend as new default application"
if ! command -v localsend &>/dev/null; then
yay -S --noconfirm --needed localsend-bin yay -S --noconfirm --needed localsend-bin
fi

View File

@ -1,2 +1,5 @@
echo "Install ffmpegthumbnailer for video thumbnails in the file manager" echo "Install ffmpegthumbnailer for video thumbnails in the file manager"
if ! command -v ffmpegthumbnailer &>/dev/null; then
yay -S --noconfirm --needed ffmpegthumbnailer yay -S --noconfirm --needed ffmpegthumbnailer
fi

View File

@ -1,2 +1,5 @@
echo "Install bash-completion" echo "Install bash-completion"
if ! pacman -Q bash-completion &>/dev/null; then
yay -S --noconfirm --needed bash-completion yay -S --noconfirm --needed bash-completion
fi

View File

@ -1,2 +1,5 @@
echo "Adding gnome-keyring to make 1password work with 2FA codes" echo "Adding gnome-keyring to make 1password work with 2FA codes"
if ! command -v gnome-keyring &>/dev/null; then
yay -S --noconfirm --needed gnome-keyring yay -S --noconfirm --needed gnome-keyring
fi

View File

@ -1,5 +1,6 @@
echo "Update to use UWSM and seamless login" echo "Update to use UWSM and seamless login"
sudo rm /etc/systemd/system/getty@tty1.service.d/override.conf if ! command -v uwsm &>/dev/null; then
sudo rm -f /etc/systemd/system/getty@tty1.service.d/override.conf
sudo rmdir /etc/systemd/system/getty@tty1.service.d/ 2>/dev/null || true sudo rmdir /etc/systemd/system/getty@tty1.service.d/ 2>/dev/null || true
if [ -f "$HOME/.bash_profile" ]; then if [ -f "$HOME/.bash_profile" ]; then
@ -14,5 +15,5 @@ if [ -f "$HOME/.config/environment.d/fcitx.conf" ]; then
fi fi
omarchy-refresh-plymouth -y omarchy-refresh-plymouth -y
source ~/.local/share/omarchy/install/login.sh source ~/.local/share/omarchy/install/login.sh
fi

View File

@ -1,13 +1,5 @@
echo "Add new matte black theme" echo "Add new matte black theme"
BACKGROUNDS_DIR=~/.config/omarchy/backgrounds/
download_background_image() {
local url="$1"
local path="$2"
gum spin --title "Downloading $url as $path..." -- curl -sL -o "$BACKGROUNDS_DIR/$path" "$url"
}
if [[ ! -L "~/.config/omarchy/themes/matte-black" ]]; then if [[ ! -L "~/.config/omarchy/themes/matte-black" ]]; then
ln -snf ~/.local/share/omarchy/themes/matte-black ~/.config/omarchy/themes/ ln -snf ~/.local/share/omarchy/themes/matte-black ~/.config/omarchy/themes/
source ~/.local/share/omarchy/themes/matte-black/backgrounds.sh
fi fi

View File

@ -1,2 +0,0 @@
echo "Use latest Omarchy Waybar configuration"
omarchy-refresh-waybar

View File

@ -1,2 +1,5 @@
echo "Install missing docker-buildx package for out-of-the-box Kamal compatibility" echo "Install missing docker-buildx package for out-of-the-box Kamal compatibility"
if ! docker buildx version &>/dev/null; then
yay -S --noconfirm --needed docker-buildx yay -S --noconfirm --needed docker-buildx
fi

View File

@ -1,4 +1,5 @@
echo "Prevent docker from requiring network readiness on boot" echo "Prevent docker from requiring network readiness on boot"
if [[ ! -f /etc/systemd/system/docker.service.d/no-block-boot.conf ]]; then
sudo mkdir -p /etc/systemd/system/docker.service.d/ sudo mkdir -p /etc/systemd/system/docker.service.d/
sudo tee /etc/systemd/system/docker.service.d/no-block-boot.conf <<'EOF' sudo tee /etc/systemd/system/docker.service.d/no-block-boot.conf <<'EOF'
[Unit] [Unit]
@ -13,3 +14,4 @@ EOF
sudo systemctl daemon-reload sudo systemctl daemon-reload
sudo systemctl mask plymouth-quit-wait.service sudo systemctl mask plymouth-quit-wait.service
fi

View File

@ -1,2 +1,5 @@
echo "Install slurp + wl-screenrec for new ALT+PrintScreen screen recorder" echo "Install slurp + wl-screenrec for new ALT+PrintScreen screen recorder"
if ! command -v wl-screenrec &>/dev/null || ! command -v slurp &>/dev/null; then
yay -S --noconfirm --needed slurp wl-screenrec yay -S --noconfirm --needed slurp wl-screenrec
fi

View File

@ -1,4 +1,4 @@
echo "Remove needless fcitx5-configtool package" echo "Remove needless fcitx5-configtool package"
if command -v fcitx5-configtool &>/dev/null; then if yay -Qe fcitx5-configtool &>/dev/null; then
yay -Rns --noconfirm fcitx5-configtool yay -Rns --noconfirm fcitx5-configtool
fi fi

View File

@ -1,2 +1,5 @@
echo "Install satty for the new screenshot flow" echo "Install satty for the new screenshot flow"
if ! command -v satty &>/dev/null; then
yay -S --noconfirm --needed satty yay -S --noconfirm --needed satty
fi

View File

@ -1,2 +1,5 @@
echo "Add missing libappindicator-gtk3 for Dropbox icon tray to work right" echo "Add missing libappindicator-gtk3 for Dropbox icon tray to work right"
if ! pacman -Q libappindicator-gtk3 &>/dev/null; then
yay -S --noconfirm --needed libappindicator-gtk3 yay -S --noconfirm --needed libappindicator-gtk3
fi

View File

@ -1,6 +1,6 @@
echo "Replace wofi with walker as the default launcher" echo "Replace wofi with walker as the default launcher"
if [[ ! -d ~/.config/walker ]]; then if ! command -v walker &>/dev/null; then
yay -Sy --noconfirm --needed walker-bin libqalculate yay -Sy --noconfirm --needed walker-bin libqalculate
yay -Rns --noconfirm wofi yay -Rns --noconfirm wofi