pfetch: initial haiku support

This commit is contained in:
Dylan Araps 2019-09-26 10:04:15 +03:00
parent 621855148b
commit 746fb0b735

20
pfetch
View File

@ -190,6 +190,12 @@ get_os() {
distro="$distro $mac_version" 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. # Catch all to ensure '$distro' is never blank.
# This also handles the BSDs. # This also handles the BSDs.
@ -200,9 +206,9 @@ get_os() {
get_kernel() { get_kernel() {
case $os in 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. # OS name includes it.
*BSD*) ;; *BSD*|Haiku) ;;
*) *)
# '$kernel' is the cached output of 'uname -r'. # '$kernel' is the cached output of 'uname -r'.
@ -267,6 +273,12 @@ get_uptime() {
# the current time in seconds. # the current time in seconds.
s=$(($(date +%s) - s)) s=$(($(date +%s) - s))
;; ;;
Haiku)
# The boot time is returned in microseconds, convert it to
# regular seconds.
s=$(($(system_time) / 1000000))
;;
esac esac
# Convert the uptime from seconds into days, hours and minutes. # Convert the uptime from seconds into days, hours and minutes.
@ -349,6 +361,10 @@ get_pkgs() {
NetBSD*) NetBSD*)
pkg_info pkg_info
;; ;;
Haiku)
printf '%s\n' /boot/system/package-links/*
;;
esac | wc -l esac | wc -l
` `