mirror of
https://github.com/xsghetti/HyprCrux.git
synced 2025-07-03 05:40:38 -04:00
Did a bunch of shit last night I dont really remember but dont wanna lose.
This commit is contained in:
parent
e8196312fe
commit
7bcecff8d1
7 changed files with 113 additions and 86 deletions
41
.config/hypr/scripts/systemupdate.sh
Normal file
41
.config/hypr/scripts/systemupdate.sh
Normal 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
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue