Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved segment adjacency #94

Merged
merged 8 commits into from
May 8, 2023

Conversation

henrypotgieter
Copy link

This PR allows for better blending of tmux-mem-cpu-load with adjacent segments so that you are able to specify the foreground/background colour to achieve the look you desire with your status line. Designed best to work with a recent approved PR to tmux-powerline: erikw/tmux-powerline#302

Prior to this change, embedding the tmux-mem-cpu-load segment within your statusbar when using tmux-powerline may have looked like this:

Before1

When using the "segment-left" (-l) and "segment-right" (-r) options to match the appropriate colors with adjacent segments we can achieve the following look.

After1

In the above usage example, -l would be passed a value of 52 and -r a value of 33, resulting in the background color of the first character in the tmux-mem-cpu-load segment being set to 52 and the foregroudn color of the last character being set to 33, eg:

tmux-mem-cpu-load -q -v -l 52 -r 33

This combines with options available to tmux-powerline after the aforementioned PR, such as the following

"disk_usage_cust 52 123 ${TMUX_POWERLINE_SEPARATOR_LEFT_BOLD} 52 123 right_disable" \ "tmux_mem_cpu_load_cust 52 234 ${TMUX_POWERLINE_SEPARATOR_LEFT_BOLD} 52 234 both_disable separator_disable" \ "batt_cust 33 154 ${TMUX_POWERLINE_SEPARATOR_LEFT_BOLD} 16 33 N separator_disable" \

The result is a powerline statusbar that appears seamless, where dynamic color changes which are part of tmux-mem-cpu-load blend well with the adjacent non-dynamic segment background colors. The options work with both left and right positions (-p & -q) of tmux-mem-cpu-load and can be set up to work if only one side of the tmux-mem-cpu-load segment has an adjacent segment or if it is wrapped with segments on both sides.

Copy link
Owner

@thewtex thewtex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@henrypotgieter very cool!! 😎

Minor requests: in the documentation, could it please be indicated that the type of the color is an integer, e.g. color -> integer color, and add a more detailed description in the README on how to identify the desired integer color.

Also, could you please add a short example, description from your PR description to the README so folks are away of how to use the tools together.

Thanks!

@henrypotgieter
Copy link
Author

No problem! Made some updates to the usage output and added some details to the README showing the before/after examples and how to achieve them in conjunction with Tmux Powerline.

Copy link
Owner

@thewtex thewtex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@henrypotgieter thanks!!

@thewtex thewtex merged commit b06c049 into thewtex:master May 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants