pfetch: Added packages and host

This commit is contained in:
Dylan Araps 2019-09-24 13:06:41 +03:00
parent 3b234ae970
commit 3f673a9045

22
pfetch
View File

@ -118,6 +118,16 @@ get_kernel() {
log kernel "$kernel_version"
}
get_host() {
case $kernel_name in
Linux*|GNU*)
read -r model < /sys/devices/virtual/dmi/id/product_version
;;
esac
log host "$model"
}
get_uptime() {
# Uptime works by retrieving the data in total seconds and then
# converting that data into days, hours and minutes using simple
@ -141,6 +151,16 @@ get_uptime() {
log uptime "${uptime:-0m}"
}
get_packages() {
case $kernel_name in
Linux*|GNU*)
command -v kiss && packages=$(kiss l | wc -l)
;;
esac >/dev/null
log pkgs "$packages"
}
get_memory() {
case $kernel_name in
# Used memory is calculated using the following "formula" (Linux):
@ -230,8 +250,10 @@ EOF
get_ascii
get_title
get_distro
get_host
get_kernel
get_uptime
get_packages
get_memory
# Position the cursor below both the ascii art and information lines.