diff options
author | Joe <rrbo@proton.me> | 2023-06-14 16:13:54 +0200 |
---|---|---|
committer | Joe <rrbo@proton.me> | 2023-06-14 16:13:54 +0200 |
commit | 15554acb39804c96985b46d99c55ac079a63b283 (patch) | |
tree | 79e5b5115406f32540d75fa8df3f68b414c10f17 /.local/bin/status/sb-memory | |
parent | up (diff) | |
download | dotfiles-bsd-15554acb39804c96985b46d99c55ac079a63b283.tar.gz dotfiles-bsd-15554acb39804c96985b46d99c55ac079a63b283.tar.bz2 dotfiles-bsd-15554acb39804c96985b46d99c55ac079a63b283.tar.xz dotfiles-bsd-15554acb39804c96985b46d99c55ac079a63b283.tar.zst dotfiles-bsd-15554acb39804c96985b46d99c55ac079a63b283.zip |
up
Diffstat (limited to '')
-rwxr-xr-x | .local/bin/status/sb-memory | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/.local/bin/status/sb-memory b/.local/bin/status/sb-memory index ecd0e3c..4901b83 100755 --- a/.local/bin/status/sb-memory +++ b/.local/bin/status/sb-memory @@ -1,7 +1,14 @@ #!/bin/sh -sysctl -n hw.physmem \ - hw.pagesize \ - vm.stats.vm.v_inactive_count \ - vm.stats.vm.v_free_count \ - vm.stats.vm.v_cache_count | xargs | awk '{printf (" %2.2fG/%2.2fG\n", ($1 / (1024 ^ 3)) - (($3 + $4 + $5) * $2 / (1024 ^ 3)), ($1 / (1024 ^ 3)))}' +case $(hostname -s) in + mother|po-rbo) + free | sed -n '2p' | awk '{printf (" %2.2fG/%2.2fG\n", ($2 / (1000 ^ 2)) - ($7 / (1000 ^ 2)), ($2 / (1000 ^ 2)))}' + ;; + mars) + sysctl -n hw.physmem \ + hw.pagesize \ + vm.stats.vm.v_inactive_count \ + vm.stats.vm.v_free_count \ + vm.stats.vm.v_cache_count | xargs | awk '{printf (" %2.2fG/%2.2fG\n", ($1 / (1024 ^ 3)) - (($3 + $4 + $5) * $2 / (1024 ^ 3)), ($1 / (1024 ^ 3)))}' + ;; +esac |