Closed jeffcap1 closed 1 month ago
dirty workaround is to change clima.conf:
set -ogq "@catppuccin_${MODULE_NAME}_text" "#(~/.config/tmux/plugins/tmux-clima/scripts/clima.sh)"
@jakub-hajek, thanks for your comment. If I run ~/.config/tmux/plugins/tmux-clima/scripts/clima.sh
in my terminal I receive the weather data as expected which is great.
Unfortunately, when I added that line to my tmux config I did not see the text appear in the clima status module. I also tried updating your suggestion to set -ogq "@catppuccin_status_clima_text" "#(~/.config/tmux/plugins/tmux-clima/scripts/clima.sh)"
but that did not work either.
I just updated to the latest version, and I can confirm the documented fix does work.
Unfortunately, adding the -F
flag, which is required to print the text, has the side effect of making the plugin not show until the tmux config is reloaded. This is similar to a previous issue, 337.
set -g @clima_unit imperial
set -g @clima_show_location 0 # hide location
set -g @clima_use_nerd_font 1
# modules list
## left
set -g status-left "#{E:@catppuccin_status_session}"
## right
set -g status-right "#{E:@catppuccin_status_application}"
set -ag status-right "#{E:@catppuccin_status_directory}"
set -ag status-right "#{E:@catppuccin_status_date_time}"
set -agF status-right "#{E:@catppuccin_status_clima}"
This is working as intended. You need to import catppuccin before the weather module. If this is not clear from the documentation, could you please send a PR making it more obvious?
Sorry, that must have been an RTFM fail on my part. I updated my config to load catppuccin first and then the clima plugin as stated in the docs. Unfortunately, I am still seeing the issue where the clima module does not load unless I refresh the config. Here are my updated settings for catppuccin and how I'm loading code through TPM.
...
# theme flavor
set -g @catppuccin_flavor "macchiato"
# status format
set -g @catppuccin_status_default "on"
set -g @catppuccin_status_background "none"
set -g @catppuccin_status_connect_separator "no"
# window icons
set -g @catppuccin_icon_window_last "σ°° "
set -g @catppuccin_icon_window_current "σ°― "
set -g @catppuccin_icon_window_zoom "σ° "
set -g @catppuccin_icon_window_mark "σ° "
set -g @catppuccin_icon_window_silent "σ° "
set -g @catppuccin_icon_window_activity "σ±
« "
set -g @catppuccin_icon_window_bell "σ° "
# window format
set -g @catppuccin_window_status_style "rounded"
set -g @catppuccin_window_number_position "right"
set -g @catppuccin_window_status "icon"
# window default format
set -g @catppuccin_window_default_fill "none"
set -g @catppuccin_window_default_text "#W"
# window current format
set -g @catppuccin_window_current_fill "all"
set -g @catppuccin_window_current_text "#W"
# status format
set -g @catppuccin_status_left_separator "ξΆ"
set -g @catppuccin_status_right_separator "ξ΄ "
set -g @catppuccin_status_right_separator_inverse "no"
set -g @catppuccin_status_fill "icon"
# directory format
set -g @catppuccin_directory_text "#{b:pane_current_path}"
# date format
set -g @catppuccin_date_time_text "%H:%M"
# weather format
set -g @clima_unit imperial
set -g @clima_show_location 0 # hide location
set -g @clima_use_nerd_font 1
# modules list
## left
set -g status-left "#{E:@catppuccin_status_session}"
## right
set -g status-right "#{E:@catppuccin_status_application}"
set -ag status-right "#{E:@catppuccin_status_directory}"
set -ag status-right "#{E:@catppuccin_status_date_time}"
set -agF status-right "#{E:@catppuccin_status_clima}"
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'sainnhe/tmux-fzf'
set -g @plugin 'jimeh/tmuxifier'
# Load catppuccin theme first
set -g @plugin 'catppuccin/tmux'
# Load catppuccin plugins after
set -g @plugin 'vascomfnunes/tmux-clima'
# Fixes plugin being overwritten by theme
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
I've been trying to understand the order of operations for the battery plugin in issue #342. My dotfile rewrite efforts are here. If you just set status-right
with -g
it will leave it as #{E:@catppuccin_status_clima}
and you'll get the placeholder as it expands when you run tpm at the bottom (I think?), but if you run it with -gF
it tries to expand "#{E:@catppuccin_status_clima}"
at that point and because that's not defined yet it expands to blank. That's why we're being told to import catppuccin, then set status-right
(so the variable is defined), then import weather/battery, so adding
run "~/.config/tmux/plugins/tmux/catppuccin.tmux"
(or wherever that file lives for you) before you do your set -agF status-right
might help you out, but that's not going to be there if you run a clean_plugins
or start on a new machine, so you may have to reload the config in that case.
TPM does not do any expanding? Not sure where that conclusion came from.
You are correct that @catppuccin_status_clima
is not defined until catppuccin loads. The clima plugin isn't that complicated, it's literally a string replacement.
I would appreciate a PR with documentation updates
I'd be happy to provide a PR with updates to the documentation once I can get this working, but as it is right now, this is still not working as expected in my setup. On v0.3.0 the weather/clima plugin would load on tmux start, but in v1.x I cannot seem to get that to work unless I refresh the config.
I've also tried moving where I load catppuccin and clima to before I set my status left and right modules, and also moved everything to after I run tpm, but neither change has seemed to do what I expect.
Same issue, it does not show until I refresh my config
...
### >>>>> DEFINE TPM AND PLUIGINS FIRST
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'sainnhe/tmux-fzf'
set -g @plugin 'jimeh/tmuxifier'
# Load catppuccin theme first
set -g @plugin 'catppuccin/tmux'
# Load catppuccin plugins after
set -g @plugin 'vascomfnunes/tmux-clima'
# set -g @plugin 'xamut/tmux-weather'
### >>>>> NOW DEFINE MODULES
# modules list
## left
set -g status-left "#{E:@catppuccin_status_session}"
## right
set -g status-right "#{E:@catppuccin_status_application}"
set -ag status-right "#{E:@catppuccin_status_directory}"
set -ag status-right "#{E:@catppuccin_status_date_time}"
set -agF status-right "#{E:@catppuccin_status_clima}"
# set -ag status-right "#{E:@catppuccin_status_weather}"
# Fixes plugin being overwritten by theme
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
Clima module shows, but is blank. Upon refresh it flashes the information and then becomes blank again.
...
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'sainnhe/tmux-fzf'
set -g @plugin 'jimeh/tmuxifier'
# Load catppuccin theme first
set -g @plugin 'catppuccin/tmux'
# Load catppuccin plugins after
set -g @plugin 'vascomfnunes/tmux-clima'
# set -g @plugin 'xamut/tmux-weather'
# Fixes plugin being overwritten by theme
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
### >>>>> LOAD MODULES AFTER RUNNING TPM
# modules list
## left
set -g status-left "#{E:@catppuccin_status_session}"
## right
set -g status-right "#{E:@catppuccin_status_application}"
set -ag status-right "#{E:@catppuccin_status_directory}"
set -ag status-right "#{E:@catppuccin_status_date_time}"
set -agF status-right "#{E:@catppuccin_status_clima}"
# set -ag status-right "#{E:@catppuccin_status_weather}"
Yeah neither of those will work. You need to run clima after the status-right is set
Clima works by inspecting the status right option, and replacing a string in it. Here's the equivalent concept of string replacement for javascript: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace
Clima does the same thing with sed
Hmm, I just updated my config to the below, which I believe is what you suggested, but I am getting the same result. Not quite sure what I am doing wrong haha.
### >>>> Status modules except clima
# modules list
## left
set -g status-left "#{E:@catppuccin_status_session}"
## right
set -g status-right "#{E:@catppuccin_status_application}"
set -ag status-right "#{E:@catppuccin_status_directory}"
set -ag status-right "#{E:@catppuccin_status_date_time}"
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'sainnhe/tmux-fzf'
set -g @plugin 'jimeh/tmuxifier'
### >>>> Load Catppuccin theme
# Load catppuccin theme first
set -g @plugin 'catppuccin/tmux'
### >>>> Define clima status module and then load it immediately after
# Load catppuccin plugins after
set -agF status-right "#{E:@catppuccin_status_clima}"
set -g @plugin 'vascomfnunes/tmux-clima'
# set -g @plugin 'xamut/tmux-weather'
# Fixes plugin being overwritten by theme
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
Where are you loading catppuccin before running tpm?
In that last example, TPM is set/loaded, then catppuccin is being loaded right before I am setting and running the clima plugin. At the end of the file TPM is actually run.
set -g @plugin
actually does nothing. It's a string that is searched for by the TPM script. You aren't loading anything until you use run
.
There's no magic here, set
just sets an option. It's not loading anything.
That all makes sense to me. Options are being set in the config and then executed when using the tpm run command.
I guess I am misunderstanding your question then about loading catppuccin. I set the plugin before I run tpm, but is there something else I should be doing to load catppuccin?
Would you mind correcting the snippet I provided so it is running in the correct order as you would expect it? I can then update my config to see if that fixes the issue on my end.
### >>>> Status modules except clima
# modules list
## left
set -g status-left "#{E:@catppuccin_status_session}"
## right
set -g status-right "#{E:@catppuccin_status_application}"
set -ag status-right "#{E:@catppuccin_status_directory}"
set -ag status-right "#{E:@catppuccin_status_date_time}"
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'sainnhe/tmux-fzf'
set -g @plugin 'jimeh/tmuxifier'
### >>>> Load Catppuccin theme
# Load catppuccin theme first
set -g @plugin 'catppuccin/tmux'
### >>>> Define clima status module and then load it immediately after
# Load catppuccin plugins after
set -agF status-right "#{E:@catppuccin_status_clima}"
set -g @plugin 'vascomfnunes/tmux-clima'
# set -g @plugin 'xamut/tmux-weather'
# Fixes plugin being overwritten by theme
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
@jeffcap1 I think the expected order is following.
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'catppuccin/tmux'
set -g @plugin 'vascomfnunes/tmux-clima'
run '~/.tmux/plugins/tpm/tpm'
set -g status-left "#{E:@catppuccin_status_session}"
set -g status-right "#{E:@catppuccin_status_application}"
set -ag status-right "#{E:@catppuccin_status_directory}"
set -ag status-right "#{E:@catppuccin_status_date_time}"
set -agF status-right "#{E:@catppuccin_status_clima}"
However, this doesnβt work well in my environment either...
That's wrong as well... Like I have said, twice
run '~/.tmux/plugins/tpm/tpm'
set -g status-left "#{E:@catppuccin_status_session}"
set -g status-right "#{E:@catppuccin_status_application}"
set -ag status-right "#{E:@catppuccin_status_directory}"
set -ag status-right "#{E:@catppuccin_status_date_time}"
set -agF status-right "#{E:@catppuccin_status_clima}"
run '~/.tmux/plugins/tpm/tpm'
# Surprise, it doesn't matter where these go. They do nothing except give instructions to TPM
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'catppuccin/tmux'
set -g @plugin 'vascomfnunes/tmux-clima'
@catppuccin_status_clima
is a global option. If you haven't run catppuccin yet, why would it be defined?
Additionally, if status-right isn't set, then why would the clima plugin work?
I got it working, but it needed to be run 3 times.
run '~/.tmux/plugins/tpm/tpm'
# modules list
## left
set -g status-left "#{E:@catppuccin_status_session}"
## right
set -g status-right "#{E:@catppuccin_status_application}"
set -ag status-right "#{E:@catppuccin_status_directory}"
set -ag status-right "#{E:@catppuccin_status_date_time}"
set -agF status-right "#{E:@catppuccin_status_clima}"
# set -ag status-right "#{E:@catppuccin_status_weather}"
run '~/.tmux/plugins/tpm/tpm'
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'sainnhe/tmux-fzf'
set -g @plugin 'jimeh/tmuxifier'
# Load catppuccin theme first
set -g @plugin 'catppuccin/tmux'
# Load catppuccin plugins after
set -g @plugin 'vascomfnunes/tmux-clima'
# set -g @plugin 'xamut/tmux-weather'
# Fixes plugin being overwritten by theme
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
Thank you @kjnsn for all of your support on this.
Is there an existing issue outlining your problem?
Describe your problem.
The weather module does not appear to be working after upgrading to v1.0.0. On v0.3.0 I was using
tmux-weather
. After I upgraded to v1.0.0 I noticed the weather module stopped working and thought it might have been an issue withtmux-weather
so I switched totmux-clima
, however, I'm seeing the same issue with that module as well.Paste your configuration.
Attach screenshots.
What tmux version are you seeing the issue on?
tmux 3.5
Any additional comments?
No response