From f4207ca303d4f57d1cabb6e7fa1a9a9efd68c2eb Mon Sep 17 00:00:00 2001 From: Marko Korhonen Date: Thu, 24 Jul 2025 09:11:42 -0500 Subject: [PATCH] Switch back to tmux --- config.toml | 5 +++++ home/{.tmux.conf => .config/tmux/tmux.conf} | 14 +++++++------- home/.config/zsh/01-multiplexer.zsh | 15 +++++++++++++++ home/.config/zsh/01-zellij.zsh | 4 ---- 4 files changed, 27 insertions(+), 11 deletions(-) rename home/{.tmux.conf => .config/tmux/tmux.conf} (93%) create mode 100644 home/.config/zsh/01-multiplexer.zsh delete mode 100644 home/.config/zsh/01-zellij.zsh diff --git a/config.toml b/config.toml index b3431b99..895ea0fd 100644 --- a/config.toml +++ b/config.toml @@ -163,6 +163,10 @@ chmod = "600" src = ".config/zellij/config.kdl" dst = "~/.config/zellij/config.kdl" +[dotfiles.f_tmux] +src = ".config/tmux/tmux.conf" +dst = "~/.config/tmux/tmux.conf" + [profiles.pacman] dotfiles = ["f_makepkg.conf", "f_paru.conf"] @@ -177,6 +181,7 @@ dotfiles = [ "f_ranger.conf", "f_ranger_commands.py", "f_zellij", + "f_tmux", "f_zshrc", "f_npmrc", ] diff --git a/home/.tmux.conf b/home/.config/tmux/tmux.conf similarity index 93% rename from home/.tmux.conf rename to home/.config/tmux/tmux.conf index 585da95a..4581fdde 100644 --- a/home/.tmux.conf +++ b/home/.config/tmux/tmux.conf @@ -5,16 +5,16 @@ set -g default-shell /bin/zsh unbind C-b set -g prefix C-a +set -g default-terminal "tmux" # use 'tmux' instead of 'screen-*' to enable italics support per tmux FAQ +set-option -ga terminal-overrides ",*256col*:Tc" + +# Enable mouse +set -g mouse on + # List of plugins set -g @plugin 'tmux-plugins/tpm' set -g @plugin 'tmux-plugins/tmux-sensible' set -g @plugin 'egel/tmux-gruvbox' -set -g default-terminal "tmux" # use 'tmux' instead of 'screen-*' to enable italics support per tmux FAQ -set-option -ga terminal-overrides ",*256col*:Tc" - # Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) -run -b '~/.tmux/plugins/tpm/tpm' - -# Enable mouse -set -g mouse on +run '~/.tmux/plugins/tpm/tpm' diff --git a/home/.config/zsh/01-multiplexer.zsh b/home/.config/zsh/01-multiplexer.zsh new file mode 100644 index 00000000..197f60ac --- /dev/null +++ b/home/.config/zsh/01-multiplexer.zsh @@ -0,0 +1,15 @@ +# Supports 'tmux', 'zellij', 'none' +PLEXER=tmux + +if [[ "$PLEXER" == 'tmux' ]]; then + PLEXER_ACTIVE="$TMUX" + PLEXER_CMD="tmux new-session -A -s SSH" +elif [[ "$PLEXER" == 'zellij' ]]; then + PLEXER_ACTIVE="$ZELLIJ" + PLEXER_CMD="zellij attach -c SSH" +fi + +# Launch or attach to existing multiplexer session if logging in over ssh +if [[ -n "$PLEXER_CMD" && -z "$PLEXER_ACTIVE" && -n "$SSH_CONNECTION" ]]; then + eval "exec $PLEXER_CMD" +fi diff --git a/home/.config/zsh/01-zellij.zsh b/home/.config/zsh/01-zellij.zsh deleted file mode 100644 index d8dfb94b..00000000 --- a/home/.config/zsh/01-zellij.zsh +++ /dev/null @@ -1,4 +0,0 @@ - # Launch or attach zellij to existing session if logging in over ssh -if [[ -z "$ZELLIJ" && -n "$SSH_CONNECTION" ]]; then - exec zellij attach -c SSH -fi