Skip to content

Commit

Permalink
Add package information and aligned text
Browse files Browse the repository at this point in the history
  • Loading branch information
ACuteWoof committed Sep 20, 2021
1 parent 7a4c82b commit 5edc464
Showing 1 changed file with 33 additions and 2 deletions.
35 changes: 33 additions & 2 deletions woofetch
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,39 @@ processor="$(cat /proc/cpuinfo | grep 'model name' | uniq | cut -d' ' -f3-)"
memory="$(cat /proc/meminfo | grep 'MemTotal' | uniq | cut -d' ' -f3- | xargs)"
editor="$EDITOR"

pack="$(which {xbps-install,apk,apt,pacman,nix,dnf,rpm,dpkg,emerge} 2>/dev/null | grep -v "not found" | awk -F/ 'NR==1{print $NF}')"
case "${pack}" in
"xbps-install")
packages=$(xbps-query -l | wc -l)
;;
"apk")
packages=$(apk search | wc -l)
;;
"apt")
packages=$(apt list --installed 2>/dev/null | wc -l)
;;
"pacman")
packages=$(pacman -Q | wc -l)
;;
"nix")
packages=$(nix-env -qa --installed "*" | wc -l)
;;
"dnf")
packages=$(dnf list installed | wc -l)
;;
"rpm")
packages=$(rpm -qa | wc -l)
;;
"emerge")
packages=$(qlist -I | wc -l)
;;
"")
packages="Unknown"
;;
esac

info(){
printf "\n$username\nKernel: $kernel\nOS: $OS\nHost: $host\nProcessor: $processor\nMemory: $memory\nEditor: $editor\n\033[40m \033[41m \033[42m \033[43m \033[44m \033[45m \033[46m \033[47m \033[0m"
printf "$username\nKernel: $kernel\nOS: $OS\nHost: $host\nProcessor: $processor\nMemory: $memory\nPackages: $packages\nEditor: $editor\n\033[40m \033[41m \033[42m \033[43m \033[44m \033[45m \033[46m \033[47m \033[0m"
}

ascii_0=" ⢀⣀⣤⣶⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣄⠀⠀⠀⠀"
Expand All @@ -24,7 +55,7 @@ ascii_8=" ⠈⠻⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀"

ascii(){
printf "\033[1m\033[93m$ascii_0\n"
printf "\033[1m\033[93m$ascii_1\n"
printf "$ascii_1\n"
printf "$ascii_2\n"
printf "$ascii_3\n"
printf "$ascii_4\n"
Expand Down

0 comments on commit 5edc464

Please sign in to comment.