From fa33fb6a9b445bdeab378f7629b49b13fc607dcf Mon Sep 17 00:00:00 2001 From: Fabio Scotto di Santolo Date: Thu, 31 Jul 2025 00:19:25 +0200 Subject: [PATCH] Integration between Tmux and ZSH --- foot/.config/foot/foot.ini | 2 +- tmux/.tmux.conf | 12 +++++++++--- zathura/.config/zathura/zathurarc | 1 - zsh/.zshrc | 3 +++ 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/foot/.config/foot/foot.ini b/foot/.config/foot/foot.ini index 87c75ff..bf98c31 100644 --- a/foot/.config/foot/foot.ini +++ b/foot/.config/foot/foot.ini @@ -1,6 +1,6 @@ # === General settings === [main] -shell=/usr/bin/tmux # Default shell to launch in the terminal +shell=/bin/zsh # Default shell to launch in the terminal font=FiraCode Nerd Font:size=14 # Font family and size used in the terminal initial-window-size-chars=160x45 # Initial size in character columns x rows selection-target=clipboard # Copy selected text directly to system clipboard diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf index edd4fc4..1390acb 100644 --- a/tmux/.tmux.conf +++ b/tmux/.tmux.conf @@ -1,9 +1,14 @@ -# Change command shortcut +#=== KEYBINDINGS ====# unbind C-b set -g prefix C-x bind C-x send-prefix -# Renumbered windows and panels +# Create new session +bind S command-prompt -p "New Session:" "new-session -A -s '%%'" +bind K confirm kill-session +set-option -g detach-on-destroy off + +#=== LAYOUT ===# set -g renumber-window on set -g base-index 1 setw -g pane-base-index 1 @@ -15,7 +20,7 @@ set -g allow-passthrough on set -ga update-environment TERM set -ga update-environment TERM_PROGRAM -# List of plugins +#=== PLUGINS ===# set -g @plugin 'tmux-plugins/tpm' set -g @plugin 'tmux-plugins/tmux-sensible' set -g @plugin 'tmux-plugins/tmux-open' @@ -39,6 +44,7 @@ set -g @catppuccin_status_right_separator "" set -g @catppuccin_status_fill "icon" set -g @catppuccin_status_connect_separator "no" set -g @catppuccin_directory_text "#{pane_current_path}" +set-option -g status-position top # Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) run '~/.tmux/plugins/tpm/tpm' diff --git a/zathura/.config/zathura/zathurarc b/zathura/.config/zathura/zathurarc index a2fc449..9f90df8 100755 --- a/zathura/.config/zathura/zathurarc +++ b/zathura/.config/zathura/zathurarc @@ -21,4 +21,3 @@ set font "FiraCode Nerd Font 15" set render-loading "false" set scroll-step 50 set selection-clipboard clipboard -include catppuccin-mocha diff --git a/zsh/.zshrc b/zsh/.zshrc index 063249c..b914887 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -127,3 +127,6 @@ source <(fzf --zsh) source "$FZF_HOME/shell/key-bindings.zsh" source "$FZF_HOME/shell/completion.zsh" +if command -v tmux &> /dev/null && [ -z "$TMUX" ]; then + tmux attach-session -t default || tmux new-session -s default +fi