diff --git a/fetch.sh b/fetch.sh index 06c13a52..0201fca4 100755 --- a/fetch.sh +++ b/fetch.sh @@ -217,7 +217,7 @@ getuptime () { ;; "OpenBSD") - uptime=$(uptime | awk -F, '{ print $1 }') + uptime=$(uptime | awk -F',' '{ print $1 }') uptime=${uptime# } uptime="${uptime# * up }" ;; @@ -303,6 +303,10 @@ getcpu () { cpu="$(sysctl -n machdep.cpu.brand_string)" ;; + "OpenBSD") + cpu="$(sysctl -n hw.model)" + ;; + *) cpu="$(awk -F ': ' '/model name/ {printf $2; exit}' /proc/cpuinfo)" @@ -343,6 +347,14 @@ getmemory () { memory="${memused}MB / ${memtotal}MB" ;; + "OpenBSD") + memtotal=$(dmesg | awk '/real mem/ {printf $5}') + memused=$(top -1 1 | awk '/Real:/ {print $3}') + memtotal=${memtotal/()MB/} + memused=${memused/M/} + memory="${memused}MB / ${memtotal}MB" + ;; + *) mem="$(awk 'NR < 4 {printf $2 " "}' /proc/meminfo)"