mirror of
https://github.com/arthur-pbty/arthur-os.git
synced 2026-08-01 20:28:16 +02:00
Don't ask to restart multiple times
This commit is contained in:
@@ -4,6 +4,10 @@
|
|||||||
|
|
||||||
echo
|
echo
|
||||||
|
|
||||||
|
confirm_reboot() {
|
||||||
|
gum confirm "$1" && { omarchy-system-reboot; exit 0; }
|
||||||
|
}
|
||||||
|
|
||||||
running_kernel=$(uname -r)
|
running_kernel=$(uname -r)
|
||||||
kernel_updated=true
|
kernel_updated=true
|
||||||
|
|
||||||
@@ -19,14 +23,14 @@ for kernel in /usr/lib/modules/*/vmlinuz; do
|
|||||||
done
|
done
|
||||||
|
|
||||||
if [[ $kernel_updated == "true" ]]; then
|
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
|
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
|
fi
|
||||||
|
|
||||||
running_hyprland=$(readlink /proc/$(pgrep -x Hyprland)/exe 2>/dev/null)
|
running_hyprland=$(readlink /proc/$(pgrep -x Hyprland)/exe 2>/dev/null)
|
||||||
if [[ $running_hyprland == *"(deleted)"* ]]; then
|
if [[ $running_hyprland == *"(deleted)"* ]]; then
|
||||||
gum confirm "Hyprland has been updated. Reboot?" && omarchy-system-reboot
|
confirm_reboot "Hyprland has been updated. Reboot?"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for file in "$HOME"/.local/state/omarchy/restart-*-required; do
|
for file in "$HOME"/.local/state/omarchy/restart-*-required; do
|
||||||
|
|||||||
Reference in New Issue
Block a user