waybar reboot indicator

This commit is contained in:
2024-10-26 15:13:49 +02:00
parent 0ba9f7f7bb
commit 5af75cdeeb
3 changed files with 24 additions and 1 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -88,6 +88,7 @@ button:hover {
#idle_inhibitor,
#scratchpad,
#custom-backup,
#custom-reboot,
#mpd {
padding: 0 10px;
color: #333333;