diff --git a/bin/omarchy-update b/bin/omarchy-update index 5299a197..2d2d3284 100755 --- a/bin/omarchy-update +++ b/bin/omarchy-update @@ -1,27 +1,8 @@ #!/bin/bash -# Exit immediately if a command exits with a non-zero status set -e -# Get the latest while trying to preserve any modifications -echo -e "\e[32mUpdate Omarchy\e[0m" -omarchy_path=~/.local/share/omarchy -git -C $omarchy_path pull --autostash -git -C $omarchy_path diff --check || git -C $omarchy_path reset --merge - -# Run migrations -~/.local/share/omarchy/bin/omarchy-migrate - -# Update system packages -echo -e "\e[32m\nUpdate system packages\e[0m" -yay -Syu --noconfirm -echo - -# Offer to reboot if the kernel has been changed -if [ "$(uname -r | sed 's/-arch/\.arch/')" != "$(pacman -Q linux | awk '{print $2}')" ]; then - gum confirm "New Linux kernel requires reboot. Ready?" && omarchy-state clear re*-required && sudo reboot now -elif [ -f "$HOME/.local/state/omarchy/reboot-required" ]; then - gum confirm "Updates require reboot. Ready?" && omarchy-state clear re*-required && sudo reboot now -elif [ -f "$HOME/.local/state/omarchy/relaunch-required" ]; then - gum confirm "Updates require Hyprland relaunch. Ready?" && omarchy-state clear relaunch-required && uwsm stop -fi +omarchy-update-git +omarchy-migrate +omarchy-update-system-pkgs +omarchy-update-restart diff --git a/bin/omarchy-update-git b/bin/omarchy-update-git new file mode 100755 index 00000000..ae1d9d49 --- /dev/null +++ b/bin/omarchy-update-git @@ -0,0 +1,5 @@ +#!/bin/bash + +echo -e "\e[32mUpdate Omarchy\e[0m" +git -C $OMARCHY_PATH pull --autostash +git -C $OMARCHY_PATH diff --check || git -C $OMARCHY_PATH reset --merge diff --git a/bin/omarchy-update-restart b/bin/omarchy-update-restart new file mode 100755 index 00000000..5d8dec0d --- /dev/null +++ b/bin/omarchy-update-restart @@ -0,0 +1,9 @@ +#!/bin/bash + +if [ "$(uname -r | sed 's/-arch/\.arch/')" != "$(pacman -Q linux | awk '{print $2}')" ]; then + gum confirm "New Linux kernel requires reboot. Ready?" && omarchy-state clear re*-required && sudo reboot now +elif [ -f "$HOME/.local/state/omarchy/reboot-required" ]; then + gum confirm "Updates require reboot. Ready?" && omarchy-state clear re*-required && sudo reboot now +elif [ -f "$HOME/.local/state/omarchy/relaunch-required" ]; then + gum confirm "Updates require Hyprland relaunch. Ready?" && omarchy-state clear relaunch-required && uwsm stop +fi diff --git a/bin/omarchy-update-system-pkgs b/bin/omarchy-update-system-pkgs new file mode 100755 index 00000000..9b65fd09 --- /dev/null +++ b/bin/omarchy-update-system-pkgs @@ -0,0 +1,5 @@ +#!/bin/bash + +echo -e "\e[32m\nUpdate system packages\e[0m" +yay -Syu --noconfirm +echo