aboutsummaryrefslogtreecommitdiffstats
path: root/polybar/scripts/check-all-updates.sh
blob: dda62123e74e881ab369f836144870b72a0b113d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash
#source https://github.com/x70b1/polybar-scripts

# Count official repo updates
if ! updates_arch=$(checkupdates 2> /dev/null | wc -l ); then
    updates_arch=0
fi

# Count AUR updates using yay
if ! updates_aur=$(yay -Qu --quiet 2> /dev/null | wc -l ); then
    updates_aur=0
fi

# Total updates
updates=$(("$updates_arch" + "$updates_aur"))

if [ "$updates" -gt 0 ]; then
    echo " $updates"
else
    echo "0"
fi