diff --git a/waybar/.config/waybar/config b/waybar/.config/waybar/config index 0c7b218..f76594b 100644 --- a/waybar/.config/waybar/config +++ b/waybar/.config/waybar/config @@ -8,7 +8,7 @@ // Choose the order of the modules "modules-left": ["sway/workspaces", "sway/window", "sway/mode"], "modules-center": [ ], - "modules-right": ["idle_inhibitor", "pulseaudio", "custom/backup", "battery", "network", "clock", "tray"], + "modules-right": ["idle_inhibitor", "custom/reboot", "pulseaudio", "custom/backup", "battery", "network", "clock", "tray"], // Modules configuration // "sway/workspaces": { // "disable-scroll": true, @@ -168,6 +168,11 @@ "format": "{} d", "exec": "$HOME/.borg/bakage.sh", "interval": 30 + }, + "custom/reboot": { + "exec": "$HOME/.config/waybar/reboot_indicator.sh", + "format": "{}", + "interval": 30 } } // vim: ft=json diff --git a/waybar/.config/waybar/reboot_indicator.sh b/waybar/.config/waybar/reboot_indicator.sh new file mode 100755 index 0000000..e407969 --- /dev/null +++ b/waybar/.config/waybar/reboot_indicator.sh @@ -0,0 +1,17 @@ +#!/bin/bash + + +RUNNING_VERSION="$(uname -r | grep -o '[0-9]*\.[0-9]*\.[0-9]*-[0-9]*')" +INSTALLED_VERSION="$(find /boot -name 'vmlinuz*' | grep -o '[0-9]*\.[0-9]*\.[0-9]*-[0-9]*' | sort -r | head -1)" + +#echo $RUNNING_VERSION +#echo $INSTALLED_VERSION + +if [[ "$RUNNING_VERSION" == "$INSTALLED_VERSION" ]] +then + echo "OK" + exit 1 +else + echo "reboot required" + exit 0 +fi diff --git a/waybar/.config/waybar/style.css b/waybar/.config/waybar/style.css index ad00f0f..f2755e9 100644 --- a/waybar/.config/waybar/style.css +++ b/waybar/.config/waybar/style.css @@ -88,6 +88,7 @@ button:hover { #idle_inhibitor, #scratchpad, #custom-backup, +#custom-reboot, #mpd { padding: 0 10px; color: #333333;