diff --git a/README.md b/README.md index 7d4a816..96bef2e 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ picture"! - **Minix** - **Solaris** - **IRIX** +- **SerenityOS** ## Configuration diff --git a/pfetch b/pfetch index cc8f341..5206ae8 100755 --- a/pfetch +++ b/pfetch @@ -484,7 +484,7 @@ get_uptime() { # converting that data into days, hours and minutes using simple # math. case $os in - (Linux* | Minix*) + (Linux* | Minix* | SerenityOS*) IFS=. read -r s _ < /proc/uptime ;; @@ -649,6 +649,13 @@ get_pkgs() { (IRIX) versions -b ;; + + (SerenityOS) + while IFS=" " read -r type _; do + [ "$type" != dependency ] && + printf "\n" + done < /usr/Ports/packages.db + ;; esac | wc -l ) @@ -899,6 +906,33 @@ get_memory() { mem_used=$((mem_full - mem_free)) ;; + + (SerenityOS) + IFS='{}' read -r _ memstat _ < /proc/memstat + + set -f -- "$IFS" + IFS=, + + for pair in $memstat; do + case $pair in + (*user_physical_allocated*) + mem_used=${pair##*:} + ;; + + (*user_physical_available*) + mem_free=${pair##*:} + ;; + esac + done + + IFS=$1 + set +f -- + + mem_used=$((mem_used * 4096 / 1024 / 1024)) + mem_free=$((mem_free * 4096 / 1024 / 1024)) + + mem_full=$((mem_used + mem_free)) + ;; esac log memory "${mem_used:-?}M / ${mem_full:-?}M" >&6 @@ -1633,6 +1667,18 @@ get_ascii() { EOF ;; + ([Ss]erenity[Oo][Ss]*) + read_ascii 4 <<-EOF + ${c7} _____ + ${c1} ,-${c7} -, + ${c1} ;${c7} ( ; + ${c1}| ${c7}. \_${c1}.,${c7} | + ${c1}| ${c7}o _${c1} ',${c7} | + ${c1} ; ${c7}(_)${c1} )${c7} ; + ${c1} '-_____-${c7}' + EOF + ;; + ([Ss]lackware*) read_ascii 4 <<-EOF ${c4} ________