waybar reboot indicator
This commit is contained in:
@@ -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
|
||||
|
||||
17
waybar/.config/waybar/reboot_indicator.sh
Executable file
17
waybar/.config/waybar/reboot_indicator.sh
Executable 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
|
||||
@@ -88,6 +88,7 @@ button:hover {
|
||||
#idle_inhibitor,
|
||||
#scratchpad,
|
||||
#custom-backup,
|
||||
#custom-reboot,
|
||||
#mpd {
|
||||
padding: 0 10px;
|
||||
color: #333333;
|
||||
|
||||
Reference in New Issue
Block a user