tmux-plugins / tmux-battery

Plug and play battery percentage and icon indicator for Tmux.
MIT License
503 stars 98 forks source link

Added commands that work with windows/cygwin #12

Closed m42e closed 5 years ago

m42e commented 9 years ago

Works at least with windows 7.

bruno- commented 9 years ago

Hey, thanks for contributing. Can you please make the following changes/additions:

m42e commented 9 years ago

Done

m42e commented 9 years ago

Please do not merge, It causes high CPU Load.. Windows is so ....

bruno- commented 9 years ago

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?

m42e commented 9 years ago

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 :( cpuload

bruno- commented 9 years ago

That's unfortunate .. let's leave the PR open for now and see if this gives someone an inspiration to try to optimize this.

m42e commented 9 years ago

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.

bruno- commented 9 years ago

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:

m42e commented 9 years ago

Well someone else might give it a try to, maybe it is only a local issue.