Closed m42e closed 5 years ago
Hey, thanks for contributing. Can you please make the following changes/additions:
CHANGELOG.md
Done
Please do not merge, It causes high CPU Load.. Windows is so ....
Hey, what is your tmux show -g status-interval
? Could it be that one is set too low (like below 5 seconds) so that's choking it?
It is set to 5 seconds but it pikes to about 50% on all my 4 cores. I don't think that good, when running on battery :(
That's unfortunate .. let's leave the PR open for now and see if this gives someone an inspiration to try to optimize this.
Well it looks like it is not wmic itself, I tried to read it using a self compiled tool and the windows API and even a fixed string. It seems the processing within bash takes that much performance.
Hm.. that's interesting.. a small bash script choking 4 processor cores.
All tmux really does is call this script every 5 seconds (if that's your status-interval
).
Do you have time to test the script so we can narrow down the issue?
This would be the steps:
tmux-battery
directory on your systemscripts/battery_percentage.sh
contains changes from this PR (windows support)scripts/battery_percentage.sh
script to make sure you get battery percentage on the outputwhile true; do scripts/battery_percentage.sh; sleep 5; done
Well someone else might give it a try to, maybe it is only a local issue.
Works at least with windows 7.