dotfiles/templates/bin/waybar-void-update-checker
2025-06-04 11:54:00 -05:00

12 lines
300 B
Bash
Executable file

#!/bin/sh
set -e
info="$(xbps-install -Mun)"
[ -z $info ] && exit
PKG_COUNT="$(echo -n "$info" | wc -l)"
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"}'