initial commit
This commit is contained in:
27
waybar/scripts/updates.sh
Executable file
27
waybar/scripts/updates.sh
Executable file
@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [ ! -f /etc/arch-release ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
AUR=$(paru -Qua | wc -l)
|
||||
OFFICIAL=$(checkupdates | wc -l)
|
||||
|
||||
case $1 in
|
||||
aur) echo " $AUR";;
|
||||
official) echo " $OFFICIAL";;
|
||||
esac
|
||||
|
||||
if [ "$1" = "update" ]; then
|
||||
alacritty -o 'window.startup_mode="Fullscreen"' -e 'paru'
|
||||
fi
|
||||
|
||||
if [ "$1" = "json" ]; then
|
||||
COUNT=$((OFFICIAL+AUR))
|
||||
|
||||
echo "{ \"text\": \" $COUNT\", \"alt\": \"$COUNT Updates\", \"tooltip\": \"Updates Available\n\nAUR: $AUR\nOfficial: $OFFICIAL\nTotal: $COUNT\" }"
|
||||
fi
|
||||
|
||||
if [ "$1" = "" ]; then
|
||||
echo " $((OFFICIAL+AUR))"
|
||||
fi
|
Reference in New Issue
Block a user