aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDylan Araps <dylan.araps@gmail.com>2019-09-24 21:05:15 +0300
committerDylan Araps <dylan.araps@gmail.com>2019-09-24 21:05:15 +0300
commit4f3b0005ff4976c3c9f08fd49926f98e2d8e0f4c (patch)
tree0ea4d0908c93e0d6d8b3096ac9efd0385bdca8a3
parent6a9d36bdb931b7c3e3340bda6af612523f1580d0 (diff)
downloadpfetch-4f3b0005ff4976c3c9f08fd49926f98e2d8e0f4c.tar.gz
pfetch: more BSD support
-rwxr-xr-xpfetch14
1 files changed, 11 insertions, 3 deletions
diff --git a/pfetch b/pfetch
index 00ae7f6..e1486e3 100755
--- a/pfetch
+++ b/pfetch
@@ -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