initial minux support
This commit is contained in:
parent
090fe64dec
commit
c9c27ba54b
19
pfetch
19
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
|
||||
|
|
Loading…
Reference in New Issue
Block a user