dotfiles/templates/bin/waybar-void-update-checker

13 lines
305 B
Text
Raw Normal View History

2025-06-04 11:30:50 -05:00
#!/bin/sh
set -e
info="$(xbps-install -Mun)"
PKG_COUNT="$(echo "$info" | wc -l)"
[ $PKG_COUNT -eq 0 ] && exit
DL_SIZE="$(echo "$info" | awk '{s+=$6}END{print s}' | numfmt --to=iec-i)B"
echo '{"text": "\uf468 '"$PKG_COUNT"'", "tooltip": "'"$PKG_COUNT"' packages have updates; '"$DL_SIZE"' download"}'