renamed _wsl options to make it clearer where it's coming from

This commit is contained in:
PastaMasta 2023-05-31 23:20:24 +01:00
parent 809c90b16b
commit 6e3236ad72
3 changed files with 4 additions and 4 deletions

View file

@ -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.

View file

@ -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

View file

@ -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}')