From 17f6791ffa306168d93bc8d4a480e975a1347631 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Wed, 25 Sep 2019 08:26:34 +0300 Subject: [PATCH] docs: update --- pfetch | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/pfetch b/pfetch index 12e019b..0ee1717 100755 --- a/pfetch +++ b/pfetch @@ -79,6 +79,12 @@ log() { : $((info_height+=1)) } +# Simple function to avoid '>/dev/null' spam. +# This checks to see if a command is in '$PATH'. +has() { + command -v "$1" >/dev/null +} + get_title() { # Username is retrieved by first checking '$USER' with a fallback # to the 'whoami' command. @@ -110,6 +116,8 @@ get_os() { case $os in Linux*) + has lsb_release && distro=$(lsb_release -sd) + # Disable warning about shellcheck not being able # to read '/etc/os-release'. This is fine. # shellcheck source=/dev/null @@ -117,8 +125,8 @@ get_os() { # Special cases for distributions which don't follow. # the '/etc/os-release' "standard". - command -v crux >/dev/null && distro=$(crux) - command -v guix >/dev/null && distro='Guix System' + has crux && distro=$(crux) + has guix && distro='Guix System' ;; Darwin*) @@ -214,10 +222,6 @@ get_uptime() { } get_pkgs() { - # Simple function to avoid '>/dev/null' spam. - # This checks to see if a command is in '$PATH'. - has() { command -v "$1" >/dev/null; } - # This works by first checking for which package managers are # isntalled and finally by printing each package manager's # package list with each package one per line.