mirror of
https://github.com/tmux-plugins/tmux-cpu.git
synced 2026-09-10 07:16:16 -04:00
Fix #14
This commit is contained in:
parent
4365837368
commit
6281a72355
|
|
@ -11,7 +11,7 @@ print_cpu_percentage() {
|
|||
iostat -c 1 2 | tail -n 2 | head -n 1 | awk '{usage=100-$NF} END {printf("%5.1f%%", usage)}'
|
||||
elif is_osx; then
|
||||
iostat -c 2 disk0 | tail -n 1 | awk '{usage=100-$6} END {printf("%5.1f%%", usage)}'
|
||||
elif is_freebsd; then
|
||||
elif is_freebsd || is_openbsd; then
|
||||
iostat -c 2 | tail -n 1 | awk '{usage=100-$NF} END {printf("%5.1f%%", usage)}'
|
||||
else
|
||||
echo "Unknown iostat version please create an issue"
|
||||
|
|
|
|||
|
|
@ -17,6 +17,10 @@ is_freebsd() {
|
|||
[ $(uname) == "FreeBSD" ]
|
||||
}
|
||||
|
||||
is_openbsd() {
|
||||
[ $(uname) == "OpenBSD" ]
|
||||
}
|
||||
|
||||
is_linux() {
|
||||
[ $(uname) == "Linux" ]
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue