From 0ec44b1306afdd4ccad2547fe9dc87eeacd84161 Mon Sep 17 00:00:00 2001 From: Dreaded_X Date: Sat, 13 Apr 2024 02:18:13 +0200 Subject: [PATCH] F12 now disables outer tmux, allows for nesting + colors are not hardcoded --- tmux/dot-tmux.conf | 13 +++++++++ tmux/gruvbox.conf | 70 ++++++++++++++++++++++++---------------------- 2 files changed, 50 insertions(+), 33 deletions(-) diff --git a/tmux/dot-tmux.conf b/tmux/dot-tmux.conf index 8a20327..b0f9e4d 100644 --- a/tmux/dot-tmux.conf +++ b/tmux/dot-tmux.conf @@ -30,5 +30,18 @@ bind -n C-M-h swap-window -t -1 \; prev # Keybind for reloading config bind r source-file $DOTFILES/tmux/dot-tmux.conf \; display-message "Config reloaded..." +bind -T root F12 \ + set prefix None \;\ + set key-table off \;\ + if -F '#{pane_in_mode}' 'send-keys -X cancel' \;\ + refresh-client -S \;\ + +bind -T off F12 \ + set -u prefix \;\ + set -u key-table \;\ + refresh-client -S + +wg_is_keys_off="#([ $(tmux show-option -qv key-table) = 'off' ] && echo 'TRUE' )" + # Load theme source-file "$DOTFILES/tmux/gruvbox.conf" diff --git a/tmux/gruvbox.conf b/tmux/gruvbox.conf index 42609f6..5e9dac9 100644 --- a/tmux/gruvbox.conf +++ b/tmux/gruvbox.conf @@ -1,37 +1,43 @@ +# Colors +dark0=#282828 +dark1=#3c3836 +dark2=#504945 +dark3=#665c54 +dark4=#7c6f64 +light1=#ebdbb2 +light3=#bdae93 +light4=#a89984 +bright_yellow=#fabd2f +yellow=#d79921 +blue=#458588 +faded_blue=#076678 + +alert_color="#{?$wg_is_keys_off,$yellow,$bright_yellow}" +current_color="#{?$wg_is_keys_off,$faded_blue,$blue}" +background="#{?$wg_is_keys_off,$dark0,$dark1}" +header="#{?$wg_is_keys_off,$dark4,$light4}" +secondary="#{?$wg_is_keys_off,$dark1,$dark2}" + ## COLORSCHEME: gruvbox dark (medium) set-option -g status "on" # default statusbar color -set-option -g status-style bg=#3c3836,fg=#a89984 - -# default window title colors -set-window-option -g window-status-style bg=#3c3836,fg=#a89984 - -# default window with an activity alert -set-window-option -g window-status-activity-style bg=#fabd2f,fg=#a89984 - -# active window title colors -set-window-option -g window-status-current-style bg=#504945,fg=#ebdbb2 +set-option -g status-style bg=$background,fg=$light4 # pane border -set-option -g pane-active-border-style fg=#bdae93 -set-option -g pane-border-style fg=#665c54 +set-option -g pane-active-border-style fg=$light3 +set-option -g pane-border-style fg=$dark3 # message infos -set-option -g message-style bg=#504945,fg=#ebdbb2 +set-option -g message-style bg=$dark2,fg=$light1 # writing commands inactive -set-option -g message-command-style bg=#504945,fg=#ebdbb2 +set-option -g message-command-style bg=$dark2,fg=$light1 -# pane number display -set-option -g display-panes-active-colour "#bdae93" -set-option -g display-panes-colour "#665c54" - -# clock -set-window-option -g clock-mode-colour "#cc241d" - -# # bell -set-window-option -g window-status-bell-style bg=#fabd2f,fg=#a89984 +# bell +set-window-option -g window-status-bell-style "" +# activity +set-window-option -g window-status-activity-style "" ## Theme settings mixed with colors (unfortunately, but there is no cleaner way) set-option -g status-justify "left" @@ -41,17 +47,15 @@ set-option -g status-right-style none set-option -g status-right-length "80" set-window-option -g window-status-separator "" -set-option -g status-left "#[bg=#a89984,fg=#282828,bold] #S " -set-option -g status-right "#[bg=#3c3836,fg=#504945]#[bg=#504945,fg=#ebdbb2] %Y-%m-%d #[fg=#a89984]#[fg=#ebdbb2] %H:%M #[bg=#504945,fg=#a89984]#[bg=#a89984,fg=#282828,bold] #h " +set-option -g status-left "#[bg=$header,fg=$dark0,bold] #S " +set-option -g status-right "#{?$wg_is_keys_off,  ,}#[bg=$background,fg=$secondary]#[bg=$secondary,fg=$light1] %Y-%m-%d #[fg=$light4]#[fg=$light1] %H:%M #[bg=$secondary,fg=$header]#[bg=$header,fg=$dark0,bold] #h " set-window-option -g window-status-current-format "\ - #[bg=#458588]#{?window_start_flag,#[fg=#a89984],#[fg=#3c3836]}\ - #[fg=#282828] #I  #W#{?window_zoomed_flag, [Z],} \ - #[fg=#458588]#[bg=#3c3836]" + #[bg=$current_color]#{?window_start_flag,#[fg=$header],#[fg=$background]}\ + #[fg=$dark0] #I  #W#{?window_zoomed_flag, [Z],} \ + #[fg=$current_color]#[bg=$background]" set-window-option -g window-status-format "\ - #{?#{||:#{window_bell_flag},#{window_activity_flag}},#[bg=#fabd2f],#[bg=#504945]}#{?window_start_flag,#[fg=#a89984],#[fg=#3c3836]}\ - #{?#{||:#{window_bell_flag},#{window_activity_flag}},#[fg=#504945]#[bg=#fabd2f],#[fg=#a89984]}\ + #{?#{||:#{window_bell_flag},#{window_activity_flag}},#[bg=$alert_color],#[bg=$secondary]}#{?window_start_flag,#[fg=$header],#[fg=$background]}\ + #{?#{||:#{window_bell_flag},#{window_activity_flag}},#[fg=$secondary]#[bg=$alert_color],#[fg=$light4]}\ #I  #W \ - #[bg=#3c3836]#{?#{||:#{window_bell_flag},#{window_activity_flag}},#[fg=#fabd2f],#[fg=#504945]}" - -# vim: set ft=tmux tw=0 nowrap: + #[bg=$background]#{?#{||:#{window_bell_flag},#{window_activity_flag}},#[fg=$alert_color],#[fg=$secondary]}"