elenapan / dotfiles

There is no place like ~/
GNU General Public License v2.0
3.48k stars 178 forks source link

CPU usage bar inverted #142

Closed lemones closed 3 years ago

lemones commented 3 years ago

The CPU usage bar is inverted. Like if 10% of CPU are in use, the bar will color fill 90%. This is because of vmstat 1 2 | tail -1 | awk '{printf \"%d\", $15}' from evil::cpu returns CPU free, not CPU in use.

All other bars shows usage. By adding 100- should give a more logic bar for CPU vmstat 1 2 | tail -1 | awk '{printf \"%d\", 100-$15}

My problem after changing this is that now the tooltip of CPU usage when mouse hoover the bar, is inverted. So if I'm using 10%, the tooltip say I use 90%. But the bar is correctly filled now.

Any suggestions how to fix this?

lemones commented 3 years ago

Found a solution.

Restored the vmstat values I changed from my topic post and instead edited noodle::cpu_bar cpu_bar.value = tonumber(100 - value) to cpu_bar.value = tonumber(value)

Now both the bar and tooltip show correct values