diff options
| author | Dylan Araps <dylan.araps@gmail.com> | 2019-09-24 21:05:15 +0300 |
|---|---|---|
| committer | Dylan Araps <dylan.araps@gmail.com> | 2019-09-24 21:05:15 +0300 |
| commit | 4f3b0005ff4976c3c9f08fd49926f98e2d8e0f4c (patch) | |
| tree | 0ea4d0908c93e0d6d8b3096ac9efd0385bdca8a3 | |
| parent | 6a9d36bdb931b7c3e3340bda6af612523f1580d0 (diff) | |
| download | pfetch-4f3b0005ff4976c3c9f08fd49926f98e2d8e0f4c.tar.gz | |
pfetch: more BSD support
| -rwxr-xr-x | pfetch | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -134,7 +134,7 @@ get_kernel() { case $os in # Don't print kernel output on BSD systems as the # OS name includes it. - *BSD) ;; + *BSD*) ;; *) log kernel "$kernel" @@ -154,6 +154,14 @@ get_host() { host="$name $version $model" ;; + + Darwin*) + host=$(sysctl -n hw.model) + ;; + + *BSD*) + host=$(sysctl -n hw.vendor hw.product) + ;; esac log host "$host" @@ -168,7 +176,7 @@ get_uptime() { IFS=. read -r s _ < /proc/uptime ;; - Darwin*|BSD*) + Darwin*|*BSD*) s=$(sysctl -n kern.boottime) # Extract the uptime in seconds from the following output: @@ -238,7 +246,7 @@ get_pkgs() { has pkg && pkg info ;; - BSD*) + *BSD*) # Commands which print packages one per line. has pkginfo && pkginfo -i has pkg && pkg list |
