Hyprland-dotfiles/scripts/updates.sh

27 lines
636 B
Bash
Raw Normal View History

2023-08-31 05:43:42 -04:00
#!/bin/sh
# _ _ _ _
# | | | |_ __ __| | __ _| |_ ___ ___
# | | | | '_ \ / _` |/ _` | __/ _ \/ __|
# | |_| | |_) | (_| | (_| | || __/\__ \
# \___/| .__/ \__,_|\__,_|\__\___||___/
# |_|
#
# by Stephan Raabe (2023)
# -----------------------------------------------------
if ! updates_arch=$(checkupdates 2> /dev/null | wc -l ); then
updates_arch=0
fi
if ! updates_aur=$(trizen -Su --aur --quiet | wc -l); then
updates_aur=0
fi
updates=$(("$updates_arch" + "$updates_aur"))
if [ "$updates" -gt 0 ]; then
echo " $updates"
else
echo "0"
fi