diff options
| author | Dylan Araps <dylan.araps@gmail.com> | 2019-09-25 08:26:34 +0300 |
|---|---|---|
| committer | Dylan Araps <dylan.araps@gmail.com> | 2019-09-25 08:26:34 +0300 |
| commit | 17f6791ffa306168d93bc8d4a480e975a1347631 (patch) | |
| tree | 598e77fee422a28431b846913b5b6c2b53fa9c4d | |
| parent | 4c20333450913f082552f2d344edc1705333633a (diff) | |
| download | pfetch-17f6791ffa306168d93bc8d4a480e975a1347631.tar.gz | |
docs: update
| -rwxr-xr-x | pfetch | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -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. |
