docs: update

This commit is contained in:
Dylan Araps 2019-09-24 21:08:33 +03:00
parent 4f3b0005ff
commit e054e5b446
2 changed files with 13 additions and 16 deletions

View File

@ -13,6 +13,16 @@ _/\ __)/_) pkgs 130
\/-____\/ memory 1721MiB / 7942MiB \/-____\/ memory 1721MiB / 7942MiB
``` ```
## OS support
- [x] Linux
- [x] MacOS
- [ ] Needs OS name detection.
- [x] OpenBSD
- [ ] Needs used memory detection.
- [x] FreeBSD
- [ ] Needs used memory detection.
## Configuration ## Configuration
`pfetch` is configured through environment variables. `pfetch` is configured through environment variables.

19
pfetch
View File

@ -241,7 +241,7 @@ get_pkgs() {
has brew && printf '%s\n' /usr/local/Cellar/* has brew && printf '%s\n' /usr/local/Cellar/*
;; ;;
FreeBSD*|Dragonfly*) FreeBSD*)
# Commands which print packages one per line. # Commands which print packages one per line.
has pkg && pkg info has pkg && pkg info
;; ;;
@ -293,27 +293,14 @@ get_memory() {
mem_full=$(($(sysctl -n hw.memsize) / 1024 / 1024)) mem_full=$(($(sysctl -n hw.memsize) / 1024 / 1024))
;; ;;
NetBSD*)
mem_full=$(($(sysctl -n hw.physmem64) / 1024 / 1024))
# NetBSD emulates a lot of the linux '/proc' filesystem.
# This is a simple loop adapted from the Linux memory
# detection.
while IFS=:kh read -r key val; do
[ "$key" = MemFree ] && mem_free=$val
done < /proc/meminfo
mem_used=$((mem_full - (mem_free / 1024)))
;;
OpenBSD*) OpenBSD*)
# If you run OpenBSD and can send me the full output of # If you run OpenBSD and can send me the full output of
# 'vm_stat' I'll be able to add full support here. # 'vm_stat' I'll be able to add full support here.
mem_full=$(($(sysctl -n hw.physmem) / 1024 / 1024)) mem_full=$(($(sysctl -n hw.physmem) / 1024 / 1024))
;; ;;
FreeBSD*|Dragonfly*) FreeBSD*)
# If you run FreeBSD or Dragonfly and can help me get # If you run FreeBSD and can help me get
# the used memory amount, I'll be able to add support here. # the used memory amount, I'll be able to add support here.
mem_full=$(($(sysctl -n hw.physmem) / 1024 / 1024)) mem_full=$(($(sysctl -n hw.physmem) / 1024 / 1024))
;; ;;