mirror of
https://git.adityakumar.xyz/dwmbar.git
synced 2024-12-23 13:32:53 +00:00
24 lines
483 B
Bash
Executable file
24 lines
483 B
Bash
Executable file
#!/bin/bash
|
|
|
|
# Prints out the number of pacman updates (Arch Linux)
|
|
# Requires an internet connection
|
|
# Depends on yay and checkupdates (pacman-contrib)
|
|
|
|
PREFIX=' Updates:'
|
|
|
|
get_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"
|
|
}
|
|
|
|
get_updates
|