aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDylan Araps <dylan.araps@gmail.com>2019-09-26 10:04:15 +0300
committerDylan Araps <dylan.araps@gmail.com>2019-09-26 10:04:15 +0300
commit746fb0b73528eef65ffeea791f11c7063ea53f38 (patch)
tree72fd461895f34b6f1802d13e6a214e45e7e0ac46
parent621855148bf9261c62480828af3195a278c49f73 (diff)
downloadpfetch-746fb0b73528eef65ffeea791f11c7063ea53f38.tar.gz
pfetch: initial haiku support
-rwxr-xr-xpfetch20
1 files changed, 18 insertions, 2 deletions
diff --git a/pfetch b/pfetch
index ab14557..a475fd9 100755
--- a/pfetch
+++ b/pfetch
@@ -190,6 +190,12 @@ get_os() {
distro="$distro $mac_version"
;;
+ Haiku)
+ # Haiku uses 'uname -v' for version information
+ # instead of 'uname -r'.
+ distro="Haiku $(uname -v)"
+ ;;
+
*)
# Catch all to ensure '$distro' is never blank.
# This also handles the BSDs.
@@ -200,9 +206,9 @@ get_os() {
get_kernel() {
case $os in
- # Don't print kernel output on BSD systems as the
+ # Don't print kernel output on some systems as the
# OS name includes it.
- *BSD*) ;;
+ *BSD*|Haiku) ;;
*)
# '$kernel' is the cached output of 'uname -r'.
@@ -267,6 +273,12 @@ get_uptime() {
# the current time in seconds.
s=$(($(date +%s) - s))
;;
+
+ Haiku)
+ # The boot time is returned in microseconds, convert it to
+ # regular seconds.
+ s=$(($(system_time) / 1000000))
+ ;;
esac
# Convert the uptime from seconds into days, hours and minutes.
@@ -349,6 +361,10 @@ get_pkgs() {
NetBSD*)
pkg_info
;;
+
+ Haiku)
+ printf '%s\n' /boot/system/package-links/*
+ ;;
esac | wc -l
`