sainnhe/tmux-fzf

[feature] add fzf colorscheme support

roachsinai opened this issue · 9 comments

Found there are many tmux colorschemes in your dotfile repos, thank for that.

Any plan to support change colorscheme?

I use a custom closed source script to change color scheme for nvim, i3, alacritty, zsh, tmux, rofi, firefox, etc. Sorry but I don't have any plan to make it open source, maybe you can write one by yourself.

Yeah and thanks for reply!

Hi @sainnhe I make it base you scripts for this plugin, and it's really simple. I just found you make so many great colorscheme, so want to use a new scheme sometimes. Below is what I tried:

~/.tmux/plugins/tmux-fzf/scripts/colorscheme.sh

#!/usr/bin/env bash

FZF_DEFAULT_OPTS=$(echo $FZF_DEFAULT_OPTS | sed -E -e '$a --header="select a colorscheme"')
CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

colorschemes_dir=~/.tmux/tmuxline
target=$(find $colorschemes_dir -type f -printf '%f\n' | sed '1i [cancel]' | eval "$CURRENT_DIR/.fzf-tmux $TMUX_FZF_OPTIONS")

[[ "$target" == "[cancel]" || -z "$target" ]] && exit

tmux source-file $colorschemes_dir/$target

Thanks!!!

Hummm, source-file not always works, it seems flush prefix_highlight_prefix_prompt setting. I'll check it later.

I'm not very sure but you may need this plugin:

set -g @plugin 'tmux-plugins/tmux-prefix-highlight'

@sainnhe I already add it to tmux.conf. But if you mean append it to colorscheme conf, this plugin not work too.

I have no idea. The color scheme files are generated by tmuxline:

:TmuxlineSnapshot! ~/.tmux/tmuxline/sonokai-shusia.tmux.conf

You can try to generate them by yourself.

Thanks!

Found that colorscheme reset status line. So need to reload tmux highlight plugin, a simple method is to add tmux run-shell ~/.tmux/plugins/tmux-prefix-highlight/prefix_highlight.tmux in the end of colorscheme.sh.