tmux-plugins / tmux-cpu

Plug and play cpu percentage and icon indicator for Tmux.
MIT License
426 stars 65 forks source link

Left side words of cpu percentage are not aligned #32

Closed narugit closed 4 years ago

narugit commented 5 years ago

Problem

Like below figure, the left side words of cpu percentage are not aligned when cpu percentage's number of digits changes.

not-align

Figure: Not aligned left words of cpu percentage

Desired Appearance

I want to align the left side words of cpu percentage not depending on cpu percentage's number of digits.

ctjhoa commented 5 years ago

This was formerly the plugin behavior. However, it has been reverted on purpose with https://github.com/tmux-plugins/tmux-cpu/pull/29 For more flexibilty, we can introduce a new variable which could enable padding.

narugit commented 5 years ago

Thank you for quick reply. I see. I'm sorry for missing it.

For more flexibilty, we can introduce a new variable which could enable padding.

Sounds great. How about introduce #{cpu_percentage_with_right_justified} which is my desired one or better idea?

ctjhoa commented 4 years ago

Sorry for the delay, I have finally introduce a new option to customize the percentage format. 0e6fb34a3ec499c6239e8bb3c4867e3449588a09

Upgrading this plugin and using:

set -g @cpu_percentage_format "%5.1f%%" # Add left padding

should solve the issue.