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

add tmux output format to i3status #484

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

oaken-source
Copy link

@oaken-source oaken-source commented Mar 5, 2022

This PR is an attempt of adding tmux as a supported output format to i3status.

tmux is a terminal multiplexer that combines multiple panes and screens with a configurable status bar, where i3status can be easily integrated by specifying the following line in tmux.conf:

set -g status-right '#(i3status)'

For an unmodified i3status, this already works as expected with the output_format set to 'none'. This PR adds 'tmux' as an additional option for output_format to enable more sophisticated output, such as colors.

tmux allows color codes in the status output in the following format:

#[fg=#abcdef]

and it is possible to reset all formatting using:

#[default]

There is one curveball, and that is that tmux requires all color hex codes to be lowercase because #F is a reserved identifier, so the following will not work as a valid color:

#[fg=#FF0000]

instead, it needs to be:

#[fg=#ff0000]

This PR addresses this behavior specifically for the tmux output_format. Everything else is very straightforward.

@primeroz
Copy link

I am really looking forward to this

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