aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDylan Araps <dylan.araps@gmail.com>2019-09-28 13:11:49 +0300
committerDylan Araps <dylan.araps@gmail.com>2019-09-28 13:11:49 +0300
commitc9c27ba54b16d1b561709191926b8e790b45e0e3 (patch)
treec6acf1c402195eeb5321d845e7207c68563a49b0
parent090fe64dece21dd49c309e29c46327c723a3d202 (diff)
downloadpfetch-c9c27ba54b16d1b561709191926b8e790b45e0e3.tar.gz
initial minux support
-rwxr-xr-xpfetch19
1 files changed, 17 insertions, 2 deletions
diff --git a/pfetch b/pfetch
index cca642d..0bf7095 100755
--- a/pfetch
+++ b/pfetch
@@ -250,7 +250,7 @@ get_kernel() {
case $os in
# Don't print kernel output on some systems as the
# OS name includes it.
- *BSD*|Haiku) ;;
+ *BSD*|Haiku|Minix) ;;
*)
# '$kernel' is the cached output of 'uname -r'.
@@ -337,7 +337,7 @@ get_uptime() {
# converting that data into days, hours and minutes using simple
# math.
case $os in
- Linux*)
+ Linux*|Minix*)
IFS=. read -r s _ < /proc/uptime
;;
@@ -444,6 +444,10 @@ get_pkgs() {
Haiku)
printf '%s\n' /boot/system/package-links/*
;;
+
+ Minix)
+ printf '%s\n' /usr/pkg/var/db/pkg/*/
+ ;;
esac | wc -l
`
@@ -589,6 +593,17 @@ get_memory() {
mem_used=$((mem_used / 1024 / 1024))
mem_full=$((mem_full / 1024 / 1024))
;;
+
+ Minix)
+ # Minix includes the '/proc' filesystem though the format
+ # differs from Linux. The '/proc/meminfo' file is only a
+ # single line with space separated elements and elements
+ # 2 and 3 contain the total and free memory numbers.
+ read -r _ mem_full mem_free _ < /proc/meminfo
+
+ mem_used=$(((mem_full - mem_free) / 1024))
+ mem_full=$(( mem_full / 1024))
+ ;;
esac
log memory "${mem_used:-?}M / ${mem_full:-?}M" >&6