ps -aux => ps aux

This commit is contained in:
Casper da Costa-Luis 2024-10-06 20:53:57 +01:00
parent 88fbb1f21f
commit d11d0b6c7a
No known key found for this signature in database
GPG key ID: D88C553DBD362CDE
2 changed files with 1 additions and 6 deletions

View file

@ -42,7 +42,7 @@ If format strings are added to `status-right`, they should now be visible.
### Optional requirements (Linux, BSD, OSX)
- `iostat` or `sar` are the best way to get an accurate CPU percentage.
A fallback is included using `ps -aux` but could be inaccurate.
A fallback is included using `ps aux` but could be inaccurate.
- `free` is used for obtaining system RAM status.
- `lm-sensors` is used for CPU temperature.
- `nvidia-smi` is required for GPU information.

View file

@ -29,14 +29,9 @@ print_cpu_percentage() {
# shellcheck disable=SC2059
printf "$cpu_percentage_format" "$usage"
else
if is_osx; then
load=$(cached_eval ps aux | awk '{print $3}' | tail -n+2 | awk '{s+=$1} END {print s}')
cpus=$(cpus_number)
echo "$load $cpus" | awk -v format="$cpu_percentage_format" '{printf format, $1/$2}'
else
load=$(cached_eval ps -aux | awk '{print $3}' | tail -n+2 | awk '{s+=$1} END {print s}')
cpus=$(cpus_number)
echo "$load $cpus" | awk -v format="$cpu_percentage_format" '{printf format, $1/$2}'
fi
fi
}