Start tmux automatically

This commit is contained in:
Asocia 2021-04-29 16:58:21 +03:00
parent 2585230e0e
commit c65d8312a3
2 changed files with 20 additions and 0 deletions

View File

@ -106,6 +106,12 @@ set -g status-right '#[fg=colour235,bg=colour235,nobold,nounderscore,noitalics]
setw -g window-status-format '#[fg=colour235,bg=colour235,nobold,nounderscore,noitalics]#[default] #I  #W #[fg=colour235,bg=colour235,nobold,nounderscore,noitalics]' setw -g window-status-format '#[fg=colour235,bg=colour235,nobold,nounderscore,noitalics]#[default] #I  #W #[fg=colour235,bg=colour235,nobold,nounderscore,noitalics]'
setw -g window-status-current-format '#[fg=colour235,bg=colour238,nobold,nounderscore,noitalics]#[fg=colour222,bg=colour238] #I  #W  #F #[fg=colour238,bg=colour235,nobold,nounderscore,noitalics]' setw -g window-status-current-format '#[fg=colour235,bg=colour238,nobold,nounderscore,noitalics]#[fg=colour222,bg=colour238] #I  #W  #F #[fg=colour238,bg=colour235,nobold,nounderscore,noitalics]'
set -g status-interval 1
set-option -g automatic-rename on
set-option -g automatic-rename-format '#{b:pane_current_path}'
# Plugin Customizations # Plugin Customizations
set -g @prefix_highlight_fg 'colour232' # default is 'colour231' set -g @prefix_highlight_fg 'colour232' # default is 'colour231'
@ -119,6 +125,9 @@ set -g @prefix_highlight_sync_prompt 'SYNC'
set -g @resurrect-strategy-vim 'session' set -g @resurrect-strategy-vim 'session'
set -g @batt_icon_status_charging '⚡' set -g @batt_icon_status_charging '⚡'
# set -g @continuum-boot 'on'
# set -g @continuum-restore 'on'
set -g @plugin 'tmux-plugins/tpm' set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible' set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-resurrect' set -g @plugin 'tmux-plugins/tmux-resurrect'

11
.zshrc
View File

@ -1,3 +1,14 @@
# Always start a tmux session when opening up terminal
if type tmux &> /dev/null; then
session_name=${YAKUAKE:-Konsole}
#if not inside a tmux session, start a new session
if [[ $HOST == "ubuntu" && -z "$TMUX" ]]; then
(tmux -2 new-session -A -s $session_name || false)
# || false makes Konsole happy while quitting. It doesn't ask for
# confirmation. Since we are in tmux, it doesn't matter if we really
# wanted to quit or not
fi
fi
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. # Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n] # Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block, everything else may go below. # confirmations, etc.) must go above this block, everything else may go below.