Did a bunch of shit last night I dont really remember but dont wanna lose.

This commit is contained in:
Dante 2024-03-01 12:51:45 -05:00 committed by GitHub
parent e8196312fe
commit 7bcecff8d1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 113 additions and 86 deletions

View file

@ -0,0 +1,41 @@
!/usr/bin/env bash
# Check release
if [ ! -f /etc/arch-release ] ; then
exit 0
fi
# source variables
ScrDir=`dirname "$(realpath "$0")"`
source $ScrDir/globalcontrol.sh
# Check for updates
get_aurhlpr
aur=`${aurhlpr} -Qua | wc -l`
ofc=`checkupdates | wc -l`
# Check for flatpak updates
if pkg_installed flatpak ; then
fpk=`flatpak remote-ls --updates | wc -l`
fpk_disp="\n󰏓 Flatpak $fpk"
fpk_exup="; flatpak update"
else
fpk=0
fpk_disp=""
fi
# Calculate total available updates
upd=$(( ofc + aur + fpk ))
# Show tooltip
if [ $upd -eq 0 ] ; then
echo "{\"text\":\"$upd\", \"tooltip\":\" Packages are up to date\"}"
else
echo "{\"text\":\"$upd\", \"tooltip\":\"󱓽 Official $ofc\n󱓾 AUR $aur$fpk_disp\"}"
fi
# Trigger upgrade
if [ "$1" == "up" ] ; then
kitty --title systemupdate sh -c "${aurhlpr} -Syu $fpk_exup"
fi