From 539248ee70dab523815d91de01ca17dbcd6bae51 Mon Sep 17 00:00:00 2001 From: John Mertz Date: Wed, 20 Jul 2022 23:11:59 -0400 Subject: [PATCH] Reboot prompt for updates Experimenting with swanag stuff. Check if reboot is required, nag to reboot, include installed packages in details. --- waybar/waybar-debian.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/waybar/waybar-debian.sh b/waybar/waybar-debian.sh index e224a13..b32fef3 100755 --- a/waybar/waybar-debian.sh +++ b/waybar/waybar-debian.sh @@ -23,6 +23,9 @@ elif [ "$1" == 'upgrade' ]; then COUNT=`apt list --upgradable 2> /dev/null | wc -l` let COUNT-- echo $COUNT > /home/jpm/.spool/apt-upgradeable + if [ -e /var/run/reboot-required ]; then + cat /var/log/apt/history.log | tr "\n" "%" | sed -e 's/.*\(Start-Date\)/\1/g' | tr "%" "\n" | swaynag --config=${HOME}/.dotfiles/sway/swaynag --edge=bottom --message="New packages require restart" --button="Restart Now" "sudo systemctl reboot" --dismiss-button="Later" --detailed-message --detailed-button "Show/Hide Upgrade Details" + fi elif [ "$1" == 'update' ]; then sudo apt update >/dev/null 2>/dev/null COUNT=`apt list --upgradable 2> /dev/null | wc -l`