waybar systemupdates icon yellow/red

This commit is contained in:
Spangenberg 2023-10-25 15:43:30 +02:00
parent 21785526a8
commit 692a072fad
3 changed files with 14 additions and 3 deletions

View File

@ -17,8 +17,10 @@ fi
updates=$(("$updates_arch" + "$updates_aur")) updates=$(("$updates_arch" + "$updates_aur"))
if [[ $updates = 0 ]]; then if [[ $updates -gt 50 ]]; then
printf '{"text": "%s", "alt": "updated", "tooltip": "%s Updates", "class": "green", "percentage": "100"}' "$updates" "$updates" printf '{"text": "%s", "alt": "require-updates", "tooltip": "%s Updates", "class": "red"}' "$updates" "$updates"
elif [[ $updates -gt 0 ]]; then
printf '{"text": "$s", "alt": "has-updates", "tooltip": "%s Updates", "class": "yellow"}' "$updates" "$updates"
else else
printf '{"text": "$s", "alt": "has-updates", "tooltip": "%s Updates", "class": "green", "percentage": "0"}' "$updates" "$updates" printf '{"text": "%s", "alt": "updated", "tooltip": "%s Updates", "class": "green"}' "$updates" "$updates"
fi fi

View File

@ -59,6 +59,7 @@
"custom/updates": { "custom/updates": {
"format": "{icon}", "format": "{icon}",
"format-icons": { "format-icons": {
"require-updates": "󰻍",
"has-updates": "󰻍", "has-updates": "󰻍",
"updated": "󰳈"}, "updated": "󰳈"},
"tooltip-format": "{}", "tooltip-format": "{}",

View File

@ -102,6 +102,14 @@ window#waybar.empty #window {
color: @iconcolor; color: @iconcolor;
} }
#custom-updates.yellow {
color: yellow;
}
#custom-updates.red {
color: red;
}
#tray { #tray {
background-color: #2980b9; background-color: #2980b9;
} }