mirror of
https://github.com/dylanaraps/neofetch.git
synced 2025-12-24 12:32:32 +00:00
Set bc scale for memory calculation.
If $HOME/.bcrc has the scale option set (scale = 8), the memory calculation will result in a string like "16384.00000000MB". This fix should result that by setting the scale to 0.
This commit is contained in:
2
neofetch
2
neofetch
@@ -1408,7 +1408,7 @@ getmemory () {
|
||||
;;
|
||||
|
||||
"Mac OS X" | "iPhone OS")
|
||||
memtotal=$(printf "%s\n" "$(sysctl -n hw.memsize)"/1024^2 | bc)
|
||||
memtotal=$(printf "scale=0; %s\n" "$(sysctl -n hw.memsize)"/1024^2 | bc)
|
||||
memwired=$(vm_stat | awk '/wired/ { print $4 }')
|
||||
memactive=$(vm_stat | awk '/active / { printf $3 }')
|
||||
memcompressed=$(vm_stat | awk '/occupied/ { printf $5 }')
|
||||
|
||||
Reference in New Issue
Block a user