dracula / tmux

🧛🏻‍♂️ Dark theme for tmux
https://draculatheme.com/tmux
MIT License
660 stars 312 forks source link

add network bandwidth support for macOS #249

Closed emmagamma closed 9 months ago

emmagamma commented 9 months ago

So I went to enable network-bandwidth (on a mac) and noticed this wasn't supported yet, but it was only after getting some custom changes working locally that I even thought to check if there was already a PR for it haha.

I see #113 exists already, but it looks like the person who made that PR just got busy with work and hasn't had time to address all the feedback and resolve the conflicts, and progress seems to have stalled on that several years ago - so I really hope I'm not stepping on any toes by making a separate PR for the same feature, but I'd really love to get this merged into the repo so that I don't need to run a modified version of this repo and manually keep it in sync with my local changes when I update to newer versions.

please let me know if there's anything I should change, happy to ^.^ (I figure you'll probably want me to squash the commits, but I'll leave them as-is for now, for convenience)

and some notes to hopefully make reviewing this a bit easier:

emmagamma commented 9 months ago

And here's a little demo of it working, side-by-side with activity monitor:

https://github.com/dracula/tmux/assets/5084142/603a3c3f-5c2a-4baa-bba9-c6e1fd36418b

you'll notice activity monitor updates more frequently than once per second, so it's showing a higher-resolution picture of your traffic and may occasionally display higher and lower spikes for tx/rx compared to the network-bandwidth in tmux. but overall they both give a very accurate indication of your traffic.

ethancedwards8 commented 9 months ago

This is wonderful, thank you so much! I definitely agree that it is more reasonable to expect awk to be installed. I have noticed that bc is not installed on many systems. No need to squash commits, everything is very clean and well written.

emmagamma commented 9 months ago

sweet! wow that was incredibly fast haha I totally expected more back and forth, thanks for the quick merge <3

ethancedwards8 commented 9 months ago

sweet! wow that was incredibly fast haha I totally expected more back and forth, thanks for the quick merge <3

You got everything right the first time! That's pretty rare around these parts ;). I can tell that you poked around the codebase to see what the code standards are, I'm impressed. Thanks again.