dwmbar/modules/archupdates

24 lines
432 B
Text
Raw Normal View History

2019-10-21 18:20:06 +00:00
#!/bin/bash
# Prints out the number of pacman updates (Arch Linux)
# Requires an internet connection
PREFIX=' Updates:'
get_updates()
2019-10-21 18:20:06 +00:00
{
if ! updates_arch=$(checkupdates 2> /dev/null | wc -l ); then
updates_arch=0
fi
if ! updates_aur=$(yay -Qum --devel 2> /dev/null | wc -l); then
updates_aur=0
fi
updates=$(("$updates_arch" + "$updates_aur"))
echo "$PREFIX $updates"
}
get_updates