mirror of
https://github.com/tmux-plugins/tmux-cpu.git
synced 2026-09-10 07:16:16 -04:00
corrected WSL free memory calculation
This commit is contained in:
parent
559f9a43f4
commit
809c90b16b
|
|
@ -19,8 +19,8 @@ print_ram_percentage() {
|
|||
|
||||
# TotalPhysicalMemory is in bytes, but FreePhysicalMemory is in KiB
|
||||
total=$(wmic.exe ComputerSystem get TotalPhysicalMemory | awk '/^[0-9]/{print $1/1024}')
|
||||
used=$(wmic.exe OS get FreePhysicalMemory | awk '/^[0-9]/{print $1}')
|
||||
|
||||
free=$(wmic.exe OS get freevirtualmemory | awk '/^[0-9]/{print $1}')
|
||||
used=$(($total - $free))
|
||||
echo "$used $total" | awk -v format="$ram_percentage_format" '{printf(format, 100*$1/$2)}'
|
||||
|
||||
elif command_exists "free"; then
|
||||
|
|
|
|||
Loading…
Reference in a new issue