From aeb7bd17f56fa0dbc172712702b7ed1d622379ad Mon Sep 17 00:00:00 2001 From: dimti Date: Tue, 12 Sep 2023 14:37:01 +0300 Subject: [PATCH] * revert auto tmux attach logic for only if TMUX is empty and if SSH_CONNECTION is active * use tmux 3+ config by default * fix default EDITOR set to vim * remove unnecessary PATH definition (previously used for correct environment for proxmox pct enter command) --- .bashrc | 2 +- .shell-env | 7 +------ .tmux.2.9+.conf => .tmux.2.8.conf | 22 ++++++++++++++-------- .tmux.conf | 22 ++++++++-------------- 4 files changed, 24 insertions(+), 29 deletions(-) rename .tmux.2.9+.conf => .tmux.2.8.conf (80%) diff --git a/.bashrc b/.bashrc index 94c7240..724351d 100644 --- a/.bashrc +++ b/.bashrc @@ -79,6 +79,6 @@ export LC_ALL=en_US.UTF-8 export LANG=ru_RU.UTF-8 # auto into tmux session -if [[ -n "$PS1" ]] && [[ -z "$TMUX" ]] || [[ -n "$PS1" ]] && [[ $TMUX == *"//"* ]]; then +if [[ -n "$PS1" ]] && [[ -z "$TMUX" ]] && [[ -n "$SSH_CONNECTION" ]]; then sudo tmux attach || sudo tmux fi diff --git a/.shell-env b/.shell-env index 876e905..be8840a 100644 --- a/.shell-env +++ b/.shell-env @@ -3,7 +3,7 @@ ## ## Editors ## -export EDITOR=nvim +export EDITOR=vim export TERMINAL=alacritty export GIT_EDITOR="$EDITOR" export USE_EDITOR="$EDITOR" @@ -21,8 +21,3 @@ if [ -f "$HOME/.shell-env.local" ]; then fi umask 022 - -## -## Correct PATH for tmux enter -## -PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin diff --git a/.tmux.2.9+.conf b/.tmux.2.8.conf similarity index 80% rename from .tmux.2.9+.conf rename to .tmux.2.8.conf index 8ebf9e6..7784375 100644 --- a/.tmux.2.9+.conf +++ b/.tmux.2.8.conf @@ -65,20 +65,26 @@ set -g status-left '' # Status bar - right side set -g status-right-length 100 -set -g status-right-style fg=black,bold -set -g status-right '#{prefix_highlight} #{?window_zoomed_flag,#[fg=colour178]ZOOMED #[fg=colour238]• ,}#[fg=colour178]#h #[fg=colour238]• #[fg=colour178]#{ip_address} #[fg=colour238]• #[fg=colour178]%a %b %d #[fg=colour178]%I:%M%P ' +set -g status-right-fg black +set -g status-right-attr bold +wg_is_keys_off="#[fg=$color_light,bg=$color_window_off_indicator]#([ $(tmux show-option -qv key-table) = 'off' ] && echo 'OFF')#[default]" +set -g status-right "$wg_is_keys_off #{prefix_highlight} #{?window_zoomed_flag,#[fg=colour178]ZOOMED #[fg=colour238]• ,}#[fg=colour178]#h #[fg=colour238]• #[fg=colour178]#{ip_address} #[fg=colour238]• #[fg=colour178]%a %b %d #[fg=colour178]%I:%M%P " # Window status - not the current window -set -g window-status-style bg=default,fg=white,none -set -g window-status-format '#[fg=colour214,bg=colour235] #I #[fg=white,bg=colour236] #(pwd="#{pane_current_path}"; echo ${pwd####*/}) #W #[default]' +set-window-option -g window-status-bg default +set-window-option -g window-status-fg white +set-window-option -g window-status-attr none +set-window-option -g window-status-format '#[fg=colour214,bg=colour235] #I #[fg=white,bg=colour236] #(pwd="#{pane_current_path}"; echo ${pwd####*/}) #W #[default]' # Window status - current window -set -g window-status-current-style none -set -g window-status-current-format '#[fg=black,bg=colour214] #I #[fg=brightwhite,bg=colour238] #(pwd="#{pane_current_path}"; echo ${pwd####*/}) #W #[default]' +set-window-option -g window-status-current-attr none +set-window-option -g window-status-current-format '#[fg=black,bg=colour214] #I #[fg=brightwhite,bg=colour238] #(pwd="#{pane_current_path}"; echo ${pwd####*/}) #W #[default]' # Pane borders -set -g pane-border-style bg=default,fg=colour235 -set -g pane-active-border-style bg=default,fg=colour214 +set -g pane-border-bg default +set -g pane-border-fg colour235 +set -g pane-active-border-bg default +set -g pane-active-border-fg colour214 # Pane number display set-option -g display-panes-active-colour colour214 diff --git a/.tmux.conf b/.tmux.conf index 7784375..8ebf9e6 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -65,26 +65,20 @@ set -g status-left '' # Status bar - right side set -g status-right-length 100 -set -g status-right-fg black -set -g status-right-attr bold -wg_is_keys_off="#[fg=$color_light,bg=$color_window_off_indicator]#([ $(tmux show-option -qv key-table) = 'off' ] && echo 'OFF')#[default]" -set -g status-right "$wg_is_keys_off #{prefix_highlight} #{?window_zoomed_flag,#[fg=colour178]ZOOMED #[fg=colour238]• ,}#[fg=colour178]#h #[fg=colour238]• #[fg=colour178]#{ip_address} #[fg=colour238]• #[fg=colour178]%a %b %d #[fg=colour178]%I:%M%P " +set -g status-right-style fg=black,bold +set -g status-right '#{prefix_highlight} #{?window_zoomed_flag,#[fg=colour178]ZOOMED #[fg=colour238]• ,}#[fg=colour178]#h #[fg=colour238]• #[fg=colour178]#{ip_address} #[fg=colour238]• #[fg=colour178]%a %b %d #[fg=colour178]%I:%M%P ' # Window status - not the current window -set-window-option -g window-status-bg default -set-window-option -g window-status-fg white -set-window-option -g window-status-attr none -set-window-option -g window-status-format '#[fg=colour214,bg=colour235] #I #[fg=white,bg=colour236] #(pwd="#{pane_current_path}"; echo ${pwd####*/}) #W #[default]' +set -g window-status-style bg=default,fg=white,none +set -g window-status-format '#[fg=colour214,bg=colour235] #I #[fg=white,bg=colour236] #(pwd="#{pane_current_path}"; echo ${pwd####*/}) #W #[default]' # Window status - current window -set-window-option -g window-status-current-attr none -set-window-option -g window-status-current-format '#[fg=black,bg=colour214] #I #[fg=brightwhite,bg=colour238] #(pwd="#{pane_current_path}"; echo ${pwd####*/}) #W #[default]' +set -g window-status-current-style none +set -g window-status-current-format '#[fg=black,bg=colour214] #I #[fg=brightwhite,bg=colour238] #(pwd="#{pane_current_path}"; echo ${pwd####*/}) #W #[default]' # Pane borders -set -g pane-border-bg default -set -g pane-border-fg colour235 -set -g pane-active-border-bg default -set -g pane-active-border-fg colour214 +set -g pane-border-style bg=default,fg=colour235 +set -g pane-active-border-style bg=default,fg=colour214 # Pane number display set-option -g display-panes-active-colour colour214