dj95 / zjstatus

A configurable statusbar plugin for zellij
MIT License
358 stars 6 forks source link

how to have a unique color for the active tab among others #63

Closed nbari closed 1 month ago

nbari commented 1 month ago

The color of all the tabs remains as the "tab_active" and is not reset after moving to another tab.

This is how it looks when tab #2 is active: (I was expecting tab 1 in white, tab 2 in orange and tab 3 in white) image

The more tabs the more confusing it gets because all reset to the same color: image

This is how it looks in tmux when tab #1 is active, the others remain in white, and if need to change to tab 3 the previous tab will change to white and the new to orange image

If a new tab is added (became the active and it looks like): image

Any idea about how to achieve this?

I am using zellij 0.40.1

This is my config:

layout {
    default_tab_template {
        pane size=1 borderless=true {
            plugin location="https://github.com/dj95/zjstatus/releases/latest/download/zjstatus.wasm" {
                format_left   "{mode} #[fg=#FDB813]{session} {tabs}"
                format_right  "{command_uptime} {datetime}"
                format_space  ""

                border_enabled  "false"
                border_char     "-"
                border_format   "#[fg=#6C7086]{char}"
                border_position "top"

                hide_frame_for_single_pane "false"

                mode_normal  "#[bg=blue] "
                mode_tmux    "#[bg=#ffc387] "
                mode_tab     "#[fg=#fff] {name} "

                tab_normal   "#[fg=#fff] {name} "
                tab_active   "#[fg=#FDB813,bold,italic] {name} "

                command_uptime_command     "sh -c \"uptime | grep -o '..user.*'\""
                command_uptime_format      "#[fg=#5E81AC] {stdout}"
                command_uptime_interval    "30"
                command_uptime_rendermode  "static"

                datetime        "#[fg=#6C7086,bold] {format} "
                datetime_format "%H:%M:%S"
                datetime_timezone "Europe/Berlin"
            }
        }
        children
    }
}

Is there also a way to only show the number, not the word Tab? and preferably the command running in that tab (similar to tmux 1:zsh) ?

dj95 commented 1 month ago

You must specify full hex rgb with 6 chars after the #. Please consult the documentation for this. That's what I wrote the wiki for.

The word "Tab" comes from zellij. Therefore it's not possible to change it.

nbari commented 1 month ago

Hi @dj95 using full hex 6 chars makes it work, thanks. I would suggest documenting this because when using 3 hex chars it works partially, at least the color changes and it is confusing, despite is common to represent colors with only 3 hex chars.