Fully rewrite without text and more colors
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
5fe15aeef4
commit
b6542d1f7e
1 changed files with 14 additions and 4 deletions
|
@ -16,9 +16,19 @@ function get_grep() {
|
||||||
|
|
||||||
updates=$(checkupdates)
|
updates=$(checkupdates)
|
||||||
|
|
||||||
num=$(echo "${updates}" | grep -c -- '->')
|
num=$(echo "${updates}" | grep -c -- '->' || true)
|
||||||
|
|
||||||
req_restart=""
|
# No updates: Gray
|
||||||
echo "${updates}" | grep -qE "^($(get_grep)) " && req_restart=' <span color="#dd0000">(reboot)</span>'
|
color="#7f7f7f"
|
||||||
|
display_num=""
|
||||||
|
|
||||||
printf "\uf94f %d %s%s" $num $(${HOME}/bin/pluralize Update $num) "${req_restart}"
|
# Normal updates: White
|
||||||
|
[ $num -gt 0 ] && {
|
||||||
|
color="#ffffff"
|
||||||
|
display_num="${num}"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Requires reboot: Red
|
||||||
|
(echo "${updates}" | grep -qE "^($(get_grep))") && color="#dd0000"
|
||||||
|
|
||||||
|
printf '<span color="%s">\uf94f %s</span>' "${color}" "${display_num}"
|
||||||
|
|
Loading…
Reference in a new issue