diff --git a/dots/.config/waybar/scripts/get-pacman-package-updates.bash b/dots/.config/waybar/scripts/get-pacman-package-updates.bash index 83c1d480..1268ae31 100755 --- a/dots/.config/waybar/scripts/get-pacman-package-updates.bash +++ b/dots/.config/waybar/scripts/get-pacman-package-updates.bash @@ -9,9 +9,11 @@ main() { if ((package_update_number > 10)); then package_updates="$(printf "%s" "${package_updates}" | head -n 10)" package_updates+="\n..." + elif (( package_update_number == 0 )); then + # Don't return anything if there are no updates available + return 0 fi - printf '{"text": "%s", "tooltip": "%s"}\n' "${package_update_number}" "${package_updates//$'\n'/\\n}" }