mirror of
https://github.com/tmux-plugins/tmux-cpu.git
synced 2026-09-10 07:16:16 -04:00
renamed _wsl options to make it clearer where it's coming from
This commit is contained in:
parent
809c90b16b
commit
6e3236ad72
|
|
@ -161,8 +161,8 @@ Don't forget to reload the tmux environment (`$ tmux source-file ~/.tmux.conf`)
|
||||||
If you're running on WSL you can set these options to get the CPU / RAM values from the Windows host system instead:
|
If you're running on WSL you can set these options to get the CPU / RAM values from the Windows host system instead:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
@cpu_wsl 'true' # true/false
|
@cpu_wsl_host 'true' # true/false
|
||||||
@ram_wsl 'true # true/false
|
@ram_wsl_host 'true # true/false
|
||||||
```
|
```
|
||||||
|
|
||||||
Note this only works if `$WSL_DISTRO_NAME` is also set, which is done by default inside WSL.
|
Note this only works if `$WSL_DISTRO_NAME` is also set, which is done by default inside WSL.
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ cpu_percentage_format="%3.1f%%"
|
||||||
print_cpu_percentage() {
|
print_cpu_percentage() {
|
||||||
cpu_percentage_format=$(get_tmux_option "@cpu_percentage_format" "$cpu_percentage_format")
|
cpu_percentage_format=$(get_tmux_option "@cpu_percentage_format" "$cpu_percentage_format")
|
||||||
|
|
||||||
if $(get_tmux_option @cpu_wsl) == "true" && test -n "${WSL_DISTRO_NAME}" ; then
|
if [[ $(get_tmux_option @cpu_wsl_host) == "true" && -n "${WSL_DISTRO_NAME}" ]] ; then
|
||||||
load="$(cached_eval wmic.exe cpu get LoadPercentage | grep -Eo '^[0-9]+')"
|
load="$(cached_eval wmic.exe cpu get LoadPercentage | grep -Eo '^[0-9]+')"
|
||||||
echo "$load" | awk -v format="$cpu_percentage_format" '{printf format, $1}'
|
echo "$load" | awk -v format="$cpu_percentage_format" '{printf format, $1}'
|
||||||
elif command_exists "iostat"; then
|
elif command_exists "iostat"; then
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ sum_macos_vm_stats() {
|
||||||
print_ram_percentage() {
|
print_ram_percentage() {
|
||||||
ram_percentage_format=$(get_tmux_option "@ram_percentage_format" "$ram_percentage_format")
|
ram_percentage_format=$(get_tmux_option "@ram_percentage_format" "$ram_percentage_format")
|
||||||
|
|
||||||
if $(get_tmux_option @ram_wsl) == "true" && test -n "${WSL_DISTRO_NAME}"; then
|
if [[ $(get_tmux_option @ram_wsl_host) == "true" && -n "${WSL_DISTRO_NAME}" ]] ; then
|
||||||
|
|
||||||
# TotalPhysicalMemory is in bytes, but FreePhysicalMemory is in KiB
|
# TotalPhysicalMemory is in bytes, but FreePhysicalMemory is in KiB
|
||||||
total=$(wmic.exe ComputerSystem get TotalPhysicalMemory | awk '/^[0-9]/{print $1/1024}')
|
total=$(wmic.exe ComputerSystem get TotalPhysicalMemory | awk '/^[0-9]/{print $1/1024}')
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue