Merge branch 'master' of github.com:dylanaraps/pfetch

This commit is contained in:
Dylan Araps 2021-09-04 20:15:50 +03:00
commit 5172f13e99
2 changed files with 48 additions and 1 deletions

View File

@ -38,6 +38,7 @@ picture"!
- **Minix**
- **Solaris**
- **IRIX**
- **SerenityOS**
## Configuration

48
pfetch
View File

@ -485,7 +485,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
;;
@ -650,6 +650,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
)
@ -900,6 +907,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
@ -1634,6 +1668,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} ________