From daf301c416a8c9fec591bb55e6422cdca4dac3d9 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Fri, 15 May 2026 15:21:03 +0200 Subject: [PATCH] Don't ask to restart multiple times --- bin/omarchy-update-restart | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/bin/omarchy-update-restart b/bin/omarchy-update-restart index 2712cd39..763d6b65 100755 --- a/bin/omarchy-update-restart +++ b/bin/omarchy-update-restart @@ -4,6 +4,10 @@ echo +confirm_reboot() { + gum confirm "$1" && { omarchy-system-reboot; exit 0; } +} + running_kernel=$(uname -r) kernel_updated=true @@ -19,14 +23,14 @@ for kernel in /usr/lib/modules/*/vmlinuz; do done if [[ $kernel_updated == "true" ]]; then - gum confirm "Linux kernel has been updated. Reboot?" && omarchy-system-reboot + confirm_reboot "Linux kernel has been updated. Reboot?" elif [[ -f $HOME/.local/state/omarchy/reboot-required ]]; then - gum confirm "Updates require reboot. Ready?" && omarchy-system-reboot + confirm_reboot "Updates require reboot. Ready?" fi running_hyprland=$(readlink /proc/$(pgrep -x Hyprland)/exe 2>/dev/null) if [[ $running_hyprland == *"(deleted)"* ]]; then - gum confirm "Hyprland has been updated. Reboot?" && omarchy-system-reboot + confirm_reboot "Hyprland has been updated. Reboot?" fi for file in "$HOME"/.local/state/omarchy/restart-*-required; do