Added support for OpenSUSE update checks with Zypper

This commit is contained in:
G2-Games 2023-05-07 17:44:44 -05:00
parent f78aed8316
commit e82a0cf000

View file

@ -119,12 +119,12 @@ updates () {
# Check for updates from different places... wonder if there's a better way # Check for updates from different places... wonder if there's a better way
updchk () { updchk () {
# Check for APT # Check for APT (Debian based)
if command -v apt-get &> /dev/null; then if command -v apt-get &> /dev/null; then
debian=$(apt-get -s dist-upgrade -V | grep -c '=>') debian=$(apt-get -s dist-upgrade -V | grep -c '=>')
fi fi
# Check for different Arch things # Check for Arch things
if command -v checkupdates &> /dev/null; then if command -v checkupdates &> /dev/null; then
arch=$(checkupdates 2> /dev/null | wc -l) arch=$(checkupdates 2> /dev/null | wc -l)
elif command -v yay &> /dev/null; then elif command -v yay &> /dev/null; then
@ -144,6 +144,12 @@ updates () {
fedora=$((fedora-1)) fedora=$((fedora-1))
fi fi
# Check for OpenSUSE things
if command -v zypper &> /dev/null; then
suse=$(zypper list-updates 2> /dev/null | wc -l)
suse=$((suse-4))
fi
# Check for Brew updates # Check for Brew updates
if command -v brew &> /dev/null; then if command -v brew &> /dev/null; then
brew=$(brew outdated 2> /dev/null | wc -l) brew=$(brew outdated 2> /dev/null | wc -l)
@ -155,7 +161,7 @@ updates () {
fi fi
# Add all update counts together # Add all update counts together
updates=$((debian + arch + fedora + flatpak + brew)) updates=$((debian + arch + fedora + suse + flatpak + brew))
echo $updates >| ~/.welcome/updates echo $updates >| ~/.welcome/updates
pkill -P "${pid}" sleep # When update checking is finished, kill the sleep function running under this bash process pkill -P "${pid}" sleep # When update checking is finished, kill the sleep function running under this bash process
sleep 5 sleep 5