rose-pine / tmux

Soho vibes for tmux
MIT License
135 stars 48 forks source link

Transparency not applying #22

Closed haydenrou closed 8 months ago

haydenrou commented 8 months ago

Hi team,

I'm attempting to enable a transparent status line with the plugin turned on, but I can't seem to get it working.

I am using alacritty with transparency on:

Screenshot 2023-12-29 at 21 16 10

With set -g @rose_pine_bar_bg_disable "on", the bar just turns to black.

Here's my tmux config: https://gist.github.com/haydenrou/071ed660c7648fc80a8dabb8c9dfda25 (I noticed I spelt pine wrong somewhere in there and fixed that)

I've tried playing around with the options quite a bit, and without the plugin activated, it is transparent.

mrs4ndman commented 8 months ago

I'd recommend, as tmux reads the file sequentially, that you put the plugin optons after the plugin definition, like this (just a snippet of how the end of the config file you linked should be):

# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'

set -g @plugin 'rose-pine/tmux'

set -g @rose_pine_variant 'moon'

# ### Theming Settings ###
# # set -g @rose_pine_date_time '' # It accepts the date UNIX command format (man date for info)
set -g @rose_pine_user 'on' # Turn on the username component in the statusbar
# set -g @rose_pine_bar_bg_disable 'on'
# # If set to 'on', disables background color, for transparent terminal emulators
set -g @rose_pine_bar_bg_disabled_color_option '0'
# # If @rose_pine_bar_bg_disable is set to 'on', uses the provided value to set the background color
set -g @rose_pine_bar_bg_disable "on"
# # It can be any of the on tmux (named colors, 256-color set, `default` or hex colors)
# # See more on http://man.openbsd.org/OpenBSD-current/man1/tmux.1#STYLES

set -g @rose_pine_disable_active_window_menu 'on' # Disables the menu that shows the active window on the left
set -g @rose_pine_show_current_program 'on' # Forces tmux to show the current running program as window name
set -g @rose_pine_show_pane_directory 'on' # Forces tmux to show the current directory as window name
set -g @rose_pine_session_icon '' # Changes the default icon to the left of the session name
set -g @rose_pine_current_window_icon '' # Changes the default icon to the left of the active window name
set -g @rose_pine_folder_icon '' # Changes the default icon to the left of the current directory folder
set -g @rose_pine_username_icon ' ' # Changes the default icon to the right of the hostname
set -g @rose_pine_date_time_icon '󰃰' # Changes the default icon to the right of the date module
set -g @rose_pine_window_status_separator "  " # Changes the default icon that appears between window names

set-option -g status-style bg=default

# turn on vi mode by pressing prefix-[
set-window-option -g mode-keys vi
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard'

# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run -b '~/.tmux/plugins/tpm/tpm'

It's a matter of load order :)

haydenrou commented 8 months ago

I tried that with the same result unfortunately (updated the gist for clarification)

mrs4ndman commented 8 months ago

Welp, then we are at a crossroad. I have tested with your config file (excluding the zsh line because I use bash), entering and exiting multiple times from tmux, and the background of the bar is not there :) Can you tell me the version of tmux you're using?

haydenrou commented 8 months ago

Hmm, that's so strange!

I'm running tmux 3.3a .

I'll keep debugging and see

haydenrou commented 8 months ago

I finally figured this out and it really reminded me I should just delve into the source-code more often.

As stated here the @rose_pine_bar_bg_disabled_color_option is used to set the bg color. The default in the README docs is 0 seemingly for transparency, and I when I tried changing this to another random number (i.e. 123) I got an initialization method - so I didn't think to look any further.

After trying a plethora of different things, I figured that I could just set this to default. This provides the same functionality as setting set-option -g status-style bg=default, but within the plugin.

I'm still not sure why adding set-option -g status-style bg=default below didn't work, but setting it manually through Ctrl-b+:set-option -g status-style bg=default did. Perhaps it's how TPM loads plugins.

@mrs4ndman Is there a reason the docs specifies using 0 as the default value for @rose_pine_bar_bg_disabled_color_option? I'm assuming so - but regardless, think a PR to add details to the docs and clarify transparency could be useful, if you don't mind me submitting that (mainly just to state that default is a valid option for transparency here). I can change the 0 too, if necessary (but I assume 0 is for a reason).

haydenrou commented 8 months ago

Closed by #24