From 692a072fad745e7b02bf7a58f7dd61e1fb27d484 Mon Sep 17 00:00:00 2001 From: Spangenberg Date: Wed, 25 Oct 2023 15:43:30 +0200 Subject: [PATCH] waybar systemupdates icon yellow/red --- scripts/checksystemupdates.sh | 8 +++++--- waybar/modules.json | 1 + waybar/themes/cantina/style.css | 8 ++++++++ 3 files changed, 14 insertions(+), 3 deletions(-) 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; }