From 3f673a904545f04871c686a2503968417b5f08e2 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Tue, 24 Sep 2019 13:06:41 +0300 Subject: [PATCH] pfetch: Added packages and host --- pfetch | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/pfetch b/pfetch index 401be56..18faecd 100755 --- a/pfetch +++ b/pfetch @@ -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.