dotfiles/.config/hypr/scripts/systemupdate.sh

28 lines
460 B
Bash
Raw Permalink Normal View History

2024-07-13 23:12:03 +05:30
#!/usr/bin/env bash
# Check release
if [ ! -f /etc/arch-release ] ; then
exit 0
fi
# Check for updates
aur=$(paru -Qua | wc -l)
ofc=$(pacman -Qu | wc -l)
# Calculate total available updates
upd=$(( ofc + aur ))
echo "$upd"
# Show tooltip
if [ $upd -eq 0 ] ; then
echo " Packages are up to date"
else
echo "󱓽 Official $ofc 󱓾 AUR $aur"
fi
# Trigger upgrade
if [ "$1" == "up" ] ; then
kitty --title systemupdate sh -c 'yay -Syu'
fi