TheRepoClub-DotFiles/localbin/.local/bin/pc

77 lines
1.6 KiB
Plaintext
Raw Normal View History

#!/usr/bin/env bash
2022-10-30 08:48:19 -04:00
#-*-coding:utf-8 -*-
#Auto updated?
# Yes
#File:
# pc
#Author:
# The-Repo-Club [wayne6324@gmail.com]
#Github:
# https://github.com/The-Repo-Club/
#
#Created:
# Sun 30 October 2022, 10:02:57 AM [GMT]
#Modified:
# Sun 30 October 2022, 10:03:20 AM [GMT]
#
#Description:
# package list
#
#Dependencies:
# pacman
#
# shellcheck disable=all
## 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