24 lines
713 B
Bash
Executable File
24 lines
713 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# If 'up' argument is passed, run update in terminal
|
|
if [ "$1" == "up" ]; then
|
|
ghostty -e bash -c "yay -Syu; echo 'Done. Press Enter.'; read"
|
|
exit 0
|
|
fi
|
|
|
|
# Otherwise, do a quick parallel check
|
|
notify-send "Checking Updates..." -t 1500
|
|
|
|
# Check Pacman and AUR in parallel
|
|
pc_count=$(checkupdates 2>/dev/null | wc -l &)
|
|
aur_count=$(yay -Qua 2>/dev/null | wc -l &)
|
|
wait
|
|
|
|
total=$((pc_count + aur_count))
|
|
|
|
if [ "$total" -eq 0 ]; then
|
|
notify-send "System Up to Date" "No packages to update." -i checkbox-checked-symbolic
|
|
else
|
|
notify-send "Updates Available" " Total: $total\nRepo: $pc_count | AUR: $aur_count\n\nPress SUPER+U to update." -i software-update-available-symbolic
|
|
fi
|