TheRepoClub-DotFiles/localbin/.local/bin/pc
The-Repo-Club dc75d84e78
Update
Signed-off-by: The-Repo-Club <wayne6324@gmail.com>
2022-01-04 16:16:43 +00:00

54 lines
1.3 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env bash
## Reset Colors
Reset='\e[0m'
### Custom colors
Purple='\e[1;35m'
Yellow='\e[1;33m'
Green='\e[1;32m'
Blue='\e[1;34m'
Cyan='\e[1;36m'
Red='\e[1;31m'
### Custom colors
declare -a repolist
col=0
###Function
function repo_list () {
repolist=($(pacman-conf -l))
for i in "${repolist[@]}"; do
count=$(paclist $i | wc -l)
col=$((col+1))
printf "\e[0;3${col}m\e[1m %s \e[0m%d\n" "$i" "$count"
done
}
function package_count () {
printf "${Red} Explicit${Reset}: %s\n" "$(pacman -Qe | wc -l)"
printf "${Green} Total${Reset}: %s\n" "$(pacman -Q | wc -l)"
if [ "$(pacman -Qqm | wc -l)" -gt "0" ]; then
printf "${Blue} AUR${Reset}: %s\n" "$(pacman -Qm | wc -l)"
fi
if command -v basher &> /dev/null; then
num=0
while read -r ; do
num=$(( num + 1))
done <<< $( basher list )
if [ "$num" -gt "0" ]; then
printf "${Yellow} Basher${Reset}: %s\n" "${num}"
fi
fi
if command -v pip &> /dev/null; then
num=0
while read -r ; do
num=$(( num + 1))
done <<< $( pip list )
if [ "$num" -gt "0" ]; then
printf "${Cyan} PIP${Reset}: %s\n" "${num}"
fi
fi
echo
repo_list
return
}
package_count