aboutsummaryrefslogtreecommitdiff
path: root/modules/archupdates
blob: da9288aa005e05b34bdfa7368069781d910a63a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash

# Prints out the number of pacman updates (Arch Linux)
# Requires an internet connection

PREFIX=' Updates:'

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

    if ! updates_aur=$(yay -Qum --devel 2> /dev/null | wc -l); then
        updates_aur=0
    fi

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

    echo "$PREFIX $updates"
}

updates