janoamaral / tokyo-night-tmux

A clean, dark Tmux theme that celebrates the lights of Downtown Tokyo at night.
https://github.com/janoamaral/tokyo-night-tmux/wiki
Other
251 stars 67 forks source link

Detect if device has a battery #77

Closed LockeAG closed 3 weeks ago

LockeAG commented 1 month ago

I created a quick solution specifically for Mac users. I also attempted to add solutions for Windows and Linux, but I couldn't test them, so feel free to give them a try. It could be a great addon.

https://github.com/LockeAG/tokyo-night-tmux/blob/master/src/battery-widget.sh

janoamaral commented 1 month ago

Hi @LockeAG, please read how to contribute to the project. Could you explain more? I find hard to know exactly what this enhancement do.

LockeAG commented 1 month ago

Thank you for the heads-up. I will adhere to the contribution guidelines.

My enhancement addresses a personal preference. Aligning with the trend of using .dotfiles. Given that I regularly work on both a MacBook and a Mac Desktop, I synchronize my tmux.conf across these machines for consistency.

The issue arose when the battery widget, enabled on desktop systems, displayed only the percentage, which became a distraction.

To resolve this, I implemented a conditional check within the configuration: if the system has a battery, display the battery status; otherwise, it is empty.

janoamaral commented 1 month ago

Yes, it seems fair. Music widget works the same. We should try to make it work in Linux also.