From ac207720f89a105a666a725ea70740da707c41d5 Mon Sep 17 00:00:00 2001 From: Eric Swanson <960576+ericrswanny@users.noreply.github.com> Date: Tue, 12 Aug 2025 01:27:00 -0500 Subject: [PATCH] Fix kernel update detection for alternative kernel variants (#585) * Fix omarchy-update kernel update message to support alternative kernel variants * fix: omarchy-update-restart kernel update message to support alternative kernel variants --- bin/omarchy-update-restart | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bin/omarchy-update-restart b/bin/omarchy-update-restart index 2f9a93cb..4501212b 100755 --- a/bin/omarchy-update-restart +++ b/bin/omarchy-update-restart @@ -1,9 +1,14 @@ #!/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 +# Check for kernel package updates since last boot +boot_time=$(date -d "$(uptime -s)" '+%Y-%m-%d %H:%M') +recent_kernel_updates=$(awk -v boot_time="$boot_time" '$0 >="["boot_time' /var/log/pacman.log | grep -E "\[ALPM\] (upgraded|installed) (linux|linux-zen|linux-lts|linux-hardened)\b" || true) +if [ -n "$recent_kernel_updates" ]; then + gum confirm "Linux kernel has been updated. Reboot?" && 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 re*-required && uwsm stop fi