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

Feature: option to disable theming #536

Closed
poetaman opened this issue Nov 20, 2021 · 11 comments
Closed

Feature: option to disable theming #536

poetaman opened this issue Nov 20, 2021 · 11 comments

Comments

@poetaman
Copy link

poetaman commented Nov 20, 2021

As per #511 (comment), please add an option to disable theming of panes and borders. That will 1) enable user to use another plugin that could handle theming in a more automated way, and/or 2) save user time/effort to change terminal theme in two places (one in their terminal emulator settings, and another in .tmux.conf.local of .tmux).

Example plugin that could do dynamic theming is showcased here: tmux/tmux#2931 (comment)

@gpakosz
Copy link
Owner

gpakosz commented Dec 27, 2022

Hello @poetaman 👋

I know I'm coming back late with a solution. You can try the gh-536 branch if you still need to disable theming

@poetaman
Copy link
Author

Hi @gpakosz 👋👋

Not a problem, I'll give it a try in next 24 hours, and report back.

@gpakosz
Copy link
Owner

gpakosz commented Dec 29, 2022

See the new .tmux.conf.local sample, add tmux_conf_theme=disabled to your ~/.tmux.conf.local copy

@gpakosz
Copy link
Owner

gpakosz commented Jan 1, 2023

Hello @poetaman,

Did you get the chance to test the branch?

@poetaman
Copy link
Author

poetaman commented Jan 2, 2023

@gpakosz I looked at the branch, it does disable the theming. Thanks! Thought it also changes the contents of status bar from using utf characters to something simpler?

@gpakosz
Copy link
Owner

gpakosz commented Jan 2, 2023

I'm not sure what you call "from using utf characters to something simpler".

It does decode unicode character escapes with

_decode_unicode_escapes() {
  printf '%s' "$*" | perl -CS -pe 's/(\\u([0-9A-Fa-f]{1,4})|\\U([0-9A-Fa-f]{1,8}))/chr(hex($2.$3))/eg' 2>/dev/null
}

e.g. it transforms \u0061 to a:

$ cut -c3- ~/.tmux.conf | sh -s _decode_unicode_escapes '\u0061'
a%

@poetaman
Copy link
Author

poetaman commented Jan 2, 2023

Look at the screenshots below:

Screenshot 2023-01-02 at 12 12 38 AM

Screenshot 2023-01-02 at 12 13 19 AM

Also, is there a way to route global/window option array pane-colours to derive color for different elements of .tmux status bar? Tmux added pane-colours array to be able to set and get global/window/pane 16 color palette.

@poetaman
Copy link
Author

poetaman commented Jan 2, 2023

Check the tmux feature here: tmux/tmux#2815 (comment)

@gpakosz
Copy link
Owner

gpakosz commented Jan 2, 2023

I don't see anything special in the screenshot.

When you disable theming, Oh my tmux! doesn't use tmux_conf_theme_status_left or tmux_conf_theme_status_right any more.

The second screen just looks like the default status-left and status-right values, except that maybe you're displaying the current path?

Does the following return what you set in your conf?

$ tmux show -g status-left
$ tmux show -g status-right

@poetaman
Copy link
Author

poetaman commented Jan 2, 2023

@gpakosz Got it, it does return what I see. There is one more intention: to adapt the theme of status bar on the fly as I change the tmux pane-colours array. What would that take? A step that could be needed for that is to keep using tmux_conf_theme_status_left and tmux_conf_theme_status_right but have a 16-color scheme that picks colors from global or window pane-colours array (if set). Might require adding a "16-color" theme option.

@gpakosz
Copy link
Owner

gpakosz commented Jan 2, 2023

Also, is there a way to route global/window option array pane-colours to derive color for different elements of .tmux status bar? Tmux added pane-colours array to be able to set and get global/window/pane 16 color palette.

I didn't know about pane-colours until you mentioned it. I tried the following

$ tmux set -g status-right '#[fg=colour1]foo'

Then

$ tmux set -g 'pane-colours[1]' '#ffffff'

And it didn't change the colour in status-right (with my terminal theme, I expected the colour to change from red to white).

But the following kinda works

$ tmux set -g status-right '#[fg=#{pane-colours[1]}foo'

Then changing pane-colours[1] updates status-right accordingly. But that's just because of how tmux variables work.

In any case, Oh my tmux! is not the proper place to implement such a thing.

@gpakosz gpakosz closed this as completed in e25c5c2 Jan 3, 2023
ooosssososos pushed a commit to ooosssososos/.tmux that referenced this issue Mar 1, 2023
farhadkarimi pushed a commit to farhadkarimi/.tmux that referenced this issue Aug 18, 2023
Rafiot pushed a commit to Rafiot/.tmux that referenced this issue Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants