diff --git a/opensuse/setup.sh b/opensuse/setup.sh index 2e8b0ee..1d70d87 100755 --- a/opensuse/setup.sh +++ b/opensuse/setup.sh @@ -249,7 +249,14 @@ if [ "$TMUX_START" == "y" ]; then # Start tmux if command -v tmux &> /dev/null && [ -n "$PS1" ] && [[ ! "$TERM" =~ screen ]] && [[ ! "$TERM" =~ tmux ]] && [ -z "$TMUX" ]; then - exec tmux + # Check if there are any existing tmux sessions + if tmux list-sessions &> /dev/null; then + # Attach to the first available session + exec tmux attach-session -t "$(tmux list-sessions -F '#{session_name}' | head -n 1)" + else + # Create a new session if no sessions exist + exec tmux + fi fi EOF else diff --git a/tmux/tmux.conf b/tmux/tmux.conf index 530cfb3..b694882 100644 --- a/tmux/tmux.conf +++ b/tmux/tmux.conf @@ -3,11 +3,18 @@ bind r source-file $XDG_CONFIG_HOME/tmux/tmux.conf \; display-message "Config re # Bind Ctrl + Space to enter copy mode bind -n C-Space copy-mode + +set-option -g status-keys vi set-window-option -g mode-keys vi set -g status-right "#[fg=yellow]Copy Mode#[default]" set -g status on +set -g status-justify left + +set -g remain-on-exit off +set -g exit-empty on + # The problem with enabling mouse support is that it doesn't work in any other app # set -g mouse on @@ -23,11 +30,11 @@ set -sa terminal-overrides "*:Tc" set -g @dracula-plugins "battery weather time" set -g @dracula-show-empty-plugins false -set -g @dracula-left-icon-padding 0 +set -g @dracula-left-icon-padding 1 -set -g @dracula-show-powerline true -set -g @dracula-show-left-sep  -set -g @dracula-show-right-sep  +set -g @dracula-show-powerline false +#set -g @dracula-show-left-sep  +#set -g @dracula-show-right-sep  set -g @dracula-battery-label false set -g @dracula-show-battery-status true