You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue: The script switches themes by sourcing only the theme files and then creating a symlink. I noticed that my TMP is working on the initial TMUX load, but after triggering notify, #{tmux_mode_indicator} becomes empty.
Workaround steps:
Update tmux-theme-mode.sh to load .tmux.conf instead of only the theme file. Additionally, creating the symlink before triggering the source helps fix the missing $TMUX_THEME_LINK file earlier.
diff --git a/scripts/tmux-theme-mode.sh b/scripts/tmux-theme-mode.sh
index 167a875..2789e89 100755
--- a/scripts/tmux-theme-mode.sh+++ b/scripts/tmux-theme-mode.sh@@ -50,8 +50,8 @@ tmux_set_theme_mode() {
echo "The configured theme is not readable: $theme_path" >&2
exit 2
fi
- tmux source-file "$theme_path"
ln -sf "$theme_path" $TMUX_THEME_LINK
+ tmux source-file "$HOME/.tmux.conf"
}
Change the initialization order in the .tmux.conf.
# dark-notify themesset -g @plugin 'erikw/tmux-dark-notify'set -g @dark-notify-theme-path-light '$HOME/.tmux/tmux-gruvbox-light.conf'set -g @dark-notify-theme-path-dark '$HOME/.tmux/tmux-gruvbox-dark.conf'# dark by default
if-shell "test ! -e ~/.local/state/tmux/tmux-dark-notify-theme.conf" \
"source-file $HOME/.tmux/tmux-gruvbox-dark.conf"# dark notify theme is it was triggered
if-shell "test -e ~/.local/state/tmux/tmux-dark-notify-theme.conf" \
"source-file ~/.local/state/tmux/tmux-dark-notify-theme.conf"# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
TPM remains at the end, as we’re re-sourcing the entire config.
The MunifTanjim/tmux-mode-indicator plugin now works with the theme.
if-shell "test ! -e ~/.local/state/tmux/tmux-dark-notify-theme.conf" ensures the default theme is used on the first launch if the symlink is not present; otherwise, the symlink will be used.
Risk: I’m not sure if it’s still an issue, but I’ve heard that re-sourcing .tmux.conf can cause problems with some plugins. However, I haven’t encountered any yet.
This is my approach to resolving the issue, but I’m open to additional suggestions on incorporating other plugins into themes.
The text was updated successfully, but these errors were encountered:
Yes I think that recall that I wanted to avoid resourcing the whole tmux.conf. I light have experienced some issues myself either plugins, or to make the plugin more snappy (can take some time to resource if it’s a complex setup).
I will be unable to look closer at this still for a while. Until then, feel free to have a fork with the fix that works for you:)
basically run '~/.tmux/plugins/tpm/tpm' at the end of the theme seems to do it as well!
As I maintain my own copy of the theme in my stow repo, this will work will less complications for me. Thx again for amazing plugin. Really helps when I need to work outside under the sun using light desktop while dark inside.
Happy holidays, and thank you for the amazing plugin—there are literally dozens of us using it! 😆
I finally found some time to report and provide a workaround for a small annoyance I encountered.
Use case: I wanted to fancy up my theme using this plugin: https://github.com/MunifTanjim/tmux-mode-indicator.
Issue: The script switches themes by sourcing only the theme files and then creating a symlink. I noticed that my TMP is working on the initial TMUX load, but after triggering
notify
,#{tmux_mode_indicator}
becomes empty.Workaround steps:
Update
tmux-theme-mode.sh
to load.tmux.conf
instead of only the theme file. Additionally, creating the symlink before triggering the source helps fix the missing$TMUX_THEME_LINK
file earlier.Change the initialization order in the
.tmux.conf
.Here's how I do it: https://github.com/choovick/.dotfiles/blob/main/stow/tmux/.tmux.conf#L140.
MunifTanjim/tmux-mode-indicator
plugin now works with the theme.if-shell "test ! -e ~/.local/state/tmux/tmux-dark-notify-theme.conf"
ensures the default theme is used on the first launch if the symlink is not present; otherwise, the symlink will be used.Risk: I’m not sure if it’s still an issue, but I’ve heard that re-sourcing
.tmux.conf
can cause problems with some plugins. However, I haven’t encountered any yet.This is my approach to resolving the issue, but I’m open to additional suggestions on incorporating other plugins into themes.
The text was updated successfully, but these errors were encountered: