2021-11-15 16:31:40 -08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
format() {
|
2022-02-10 11:18:12 -08:00
|
|
|
if [ "$1" -eq 0 ]; then
|
|
|
|
echo '-'
|
|
|
|
else
|
|
|
|
echo "$1"
|
|
|
|
fi
|
2021-11-15 16:31:40 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
if ! updates_arch="$(checkupdates | wc -l)"; then
|
2022-02-10 11:18:12 -08:00
|
|
|
updates_arch=0
|
2021-11-15 16:31:40 -08:00
|
|
|
fi
|
|
|
|
|
2022-01-24 21:59:14 -08:00
|
|
|
if ! updates_aur="$(paru -Qum 2> /dev/null | wc -l)"; then
|
2022-02-10 11:18:12 -08:00
|
|
|
updates_aur=0
|
2021-11-15 16:31:40 -08:00
|
|
|
fi
|
|
|
|
|
|
|
|
updates="$((updates_arch + updates_aur))"
|
|
|
|
|
|
|
|
if [ "$updates" -gt 0 ]; then
|
2022-02-10 11:18:12 -08:00
|
|
|
#echo " ($(format $updates_arch)/$(format $updates_aur))"
|
|
|
|
# echo " ($(format $updates_arch)/$(format $updates_aur))"
|
|
|
|
# dunstify -i "/usr/share/icons/breeze-dark/mimetypes/24/package-x-generic.svg" " Outdated Packages: ($(format $updates_arch)/$(format $updates_aur))"
|
|
|
|
# dunstify -i "/usr/share/icons/breeze-dark/mimetypes/24/package-x-generic.svg" "Outdated Packages: ($(format $updates_arch)/$(format $updates_aur))"
|
|
|
|
echo "%{B#6C77BB} %{B-}%{B#464b55} ($(format $updates_arch)/$(format $updates_aur)) %{B-}"
|
2021-11-15 16:31:40 -08:00
|
|
|
else
|
2022-02-10 11:18:12 -08:00
|
|
|
echo
|
2021-11-15 16:31:40 -08:00
|
|
|
fi
|