tmux-plugins / tmux-battery

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

Use `echo` and Append Percentage Symbol on WSL #107

Closed thekpaul closed 1 year ago

thekpaul commented 1 year ago

Instead of straightforwardly calling cat, I've encased the command in echo to enable appending strings. This allows me to add a percentage symbol after calling cat "$battery", like with other battery-related tools.

This also suppresses any echos for machines without battery (i.e. a desktop environment)

thekpaul commented 1 year ago

Something got messed up in the previous commit, so I refreshed the file locally and did a force push. The commits now appear as expected.

thekpaul commented 1 year ago

There's a problem when working with wired WSL environments (i.e. a Windows desktop - gasp) where battery-related files are nonexistent to begin with. I'll be building on this commit to provide better return formats for these types of environments, and in the meantime, will be closing this pull request...but I'll be back ;)

thekpaul commented 1 year ago

Check out #108 for an extended patch targeting WSL containing commits covered above.