diff --git a/scripts/checksystemupdates.sh b/scripts/checksystemupdates.sh index 4faa971..477dbd0 100755 --- a/scripts/checksystemupdates.sh +++ b/scripts/checksystemupdates.sh @@ -17,8 +17,10 @@ fi updates=$(("$updates_arch" + "$updates_aur")) -if [[ $updates = 0 ]]; then - printf '{"text": "%s", "alt": "updated", "tooltip": "%s Updates", "class": "green", "percentage": "100"}' "$updates" "$updates" +if [[ $updates -gt 50 ]]; then + 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 - 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 diff --git a/waybar/modules.json b/waybar/modules.json index 92eda93..f499616 100644 --- a/waybar/modules.json +++ b/waybar/modules.json @@ -59,6 +59,7 @@ "custom/updates": { "format": "{icon}", "format-icons": { + "require-updates": "󰻍", "has-updates": "󰻍", "updated": "󰳈"}, "tooltip-format": "{}", diff --git a/waybar/themes/cantina/style.css b/waybar/themes/cantina/style.css index 711bc42..457d299 100644 --- a/waybar/themes/cantina/style.css +++ b/waybar/themes/cantina/style.css @@ -102,6 +102,14 @@ window#waybar.empty #window { color: @iconcolor; } +#custom-updates.yellow { + color: yellow; +} + +#custom-updates.red { + color: red; +} + #tray { background-color: #2980b9; }