added scripts to replace waybar
This commit is contained in:
23
hypr/scripts/update-sys.sh
Executable file
23
hypr/scripts/update-sys.sh
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/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
|
||||
Reference in New Issue
Block a user