diff options
| author | Dylan Araps <dylan.araps@gmail.com> | 2019-09-24 13:06:41 +0300 |
|---|---|---|
| committer | Dylan Araps <dylan.araps@gmail.com> | 2019-09-24 13:06:41 +0300 |
| commit | 3f673a904545f04871c686a2503968417b5f08e2 (patch) | |
| tree | ed2f574925a7e3d954a3d0d869a29b841f7b5d42 | |
| parent | 3b234ae970d9a487e40a090e6fd2ef2d040c5c7b (diff) | |
| download | pfetch-3f673a904545f04871c686a2503968417b5f08e2.tar.gz | |
pfetch: Added packages and host
| -rwxr-xr-x | pfetch | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -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. |
