Is there a way to render flavor config to raw tmux config?
pentago opened this issue ยท 3 comments
I really like the colors and everything but the plugin messes up with my existing configuration (like placing status centered at the top, with a transparent background and additional status beneath that I use as a margin to separate the prompt.
I don't really want to dig into figuring out templating to be able to construct what I'm after so if possible, I'd like a way to render mocha flavor config to tmux config, without any plugins, that I can tweak to get precisely what I like and possibly play with the colors of my own.
Hopefully, a script that does this already exists and I'd appreciate having it if possible :)
Hey ๐
I'm not a tmux user but just from browsing the repository, I can see that we have .tmuxtheme
files which essentially hold the colour definitions:
E.g. Mocha
tmux/catppuccin-mocha.tmuxtheme
Lines 1 to 17 in 219ff43
And diving into the catppuccin.tmux
file, we can see that the "chosen" flavour's properties are set in a while loop:
Lines 297 to 315 in 219ff43
And then later on in the catppuccin.tmux
file, we can see that the variables can be used when wrapped with ${}
:
Line 326 in 219ff43
From reading the code above, I think you'd be able to:
- Download your chosen
.tmuxtheme
file(s) - "Import" the colours using a while loop or equivalent in your
.tmux
file. - Begin using the colours in your
.tmux
file, without any additional plugins installed.
Let me know if this works or if I've completely missed the mark ๐
Another option it to print what the plugin does and copy the parts that you need:
diff --git a/catppuccin.tmux b/catppuccin.tmux
index be45bb5..26e7820 100755
--- a/catppuccin.tmux
+++ b/catppuccin.tmux
@@ -26,12 +26,14 @@ get_tmux_option() {
set() {
local option=$1
local value=$2
+ echo set-option -gq "$option" "$value" ";" >&2
tmux_commands+=(set-option -gq "$option" "$value" ";")
}
setw() {
local option=$1
local value=$2
+ echo set-window-option -gq "$option" "$value" ";" >&2
tmux_commands+=(set-window-option -gq "$option" "$value" ";")
}
$ bash catppuccin.tmux
set-option -gq status on ;
set-option -gq status-bg #1e1e2e ;
set-option -gq status-justify left ;
set-option -gq status-left-length 100 ;
set-option -gq status-right-length 100 ;
set-option -gq message-style fg=#89dceb,bg=#313244,align=centre ;
set-option -gq message-command-style fg=#89dceb,bg=#313244,align=centre ;
set-window-option -gq pane-border-status off ;
set-window-option -gq pane-active-border-style #{?pane_in_mode,fg=#f9e2af,#{?pane_synchronized,fg=#cba6f7,fg=#fab387}} ;
set-window-option -gq pane-border-style fg=#313244 ;
set-window-option -gq pane-border-format ;
set-window-option -gq window-status-activity-style fg=#cdd6f4,bg=#1e1e2e,none ;
set-window-option -gq window-status-separator ;
set-window-option -gq window-status-style fg=#cdd6f4,bg=#1e1e2e,none ;
set-window-option -gq window-status-format #[fg=#89b4fa,bg=#1e1e2e]โ#[fg=#313244,bg=#89b4fa]#I#[fg=#89b4fa,bg=#313244,nobold,nounderscore,noitalics]โ #[fg=#cdd6f4,bg=#313244]#{window_name} #{?window_activity_flag,๓ฑ ,}#{?window_bell_flag,๓ฐ ,}#{?window_silence_flag,๓ฐ ,}#{?window_active,๏ ,}#{?window_last_flag,๏ ,}#{?window_marked_flag,๓ฐ ,}#{?window_zoomed_flag,๏ฒ ,}#[fg=#313244,bg=#1e1e2e,nobold,nounderscore,noitalics]โ ;
set-window-option -gq window-status-current-format #[fg=#fab387,bg=#1e1e2e]โ#[fg=#1e1e2e,bg=#fab387]#I#[fg=#fab387,bg=#1e1e2e,nobold,nounderscore,noitalics]โ #[fg=#cdd6f4,bg=#1e1e2e]#{window_name} #{?window_activity_flag,๓ฑ ,}#{?window_bell_flag,๓ฐ ,}#{?window_silence_flag,๓ฐ ,}#{?window_active,๏ ,}#{?window_last_flag,๏ ,}#{?window_marked_flag,๓ฐ ,}#{?window_zoomed_flag,๏ฒ ,}#[fg=#1e1e2e,bg=#1e1e2e,nobold,nounderscore,noitalics]โ ;
set-option -gq status-left ;
set-option -gq status-right #[fg=#f5c2e7,bg=#1e1e2e,nobold,nounderscore,noitalics]โ#[fg=#1e1e2e,bg=#f5c2e7,nobold,nounderscore,noitalics]๏ฎ #[fg=#cdd6f4,bg=#313244] #W#[fg=#313244,bg=#313244,nobold,nounderscore,noitalics]โ#[fg=#{?client_prefix,#f38ba8,#a6e3a1},bg=#313244,nobold,nounderscore,noitalics]โ#[fg=#1e1e2e,bg=#{?client_prefix,#f38ba8,#a6e3a1},nobold,nounderscore,noitalics]๎ #[fg=#cdd6f4,bg=#313244] #S#[fg=#313244,bg=#313244,nobold,nounderscore,noitalics]โ ;
set-window-option -gq clock-mode-colour #89b4fa ;
set-window-option -gq mode-style fg=#f5c2e7 bg=#585b70 bold ;