From 31e5d189c5d80d904a4cf651e428d7af77f381ad Mon Sep 17 00:00:00 2001 From: mg Date: Fri, 30 Jul 2021 07:40:30 +0200 Subject: [PATCH] tmux auto attach (#180) tmux auto attach Co-authored-by: Michael Grote Reviewed-on: https://git.mgrote.net/mg/ansible/pulls/180 Co-Authored-By: mg Co-Committed-By: mg --- group_vars/laptop.yml | 2 ++ roles/mgrote.tmux/defaults/main.yml | 1 + roles/mgrote.tmux/tasks/main.yml | 1 + 3 files changed, 4 insertions(+) diff --git a/group_vars/laptop.yml b/group_vars/laptop.yml index 91b9382f..86218093 100644 --- a/group_vars/laptop.yml +++ b/group_vars/laptop.yml @@ -1,4 +1,6 @@ --- + ### mgrote.tmux + tmux_auto_attach: absent ### mgrote.dotfiles dotfiles_repo_url: https://git.mgrote.net/mg/dotfiles dotfiles_repo_path: /home/mg/dotfiles diff --git a/roles/mgrote.tmux/defaults/main.yml b/roles/mgrote.tmux/defaults/main.yml index 18cd7cfc..324bc15c 100644 --- a/roles/mgrote.tmux/defaults/main.yml +++ b/roles/mgrote.tmux/defaults/main.yml @@ -2,3 +2,4 @@ tmux_conf_destination: "/home/mg/.tmux.conf" tmux_bashrc_destination: "/home/mg/.bashrc" tmux_standardsession_name: "default" + tmux_auto_attach: present # or absent; soll bei jedem shell-start automatisch eine tmux session erstellt oder attached werden diff --git a/roles/mgrote.tmux/tasks/main.yml b/roles/mgrote.tmux/tasks/main.yml index ad921be9..0dbf18a2 100644 --- a/roles/mgrote.tmux/tasks/main.yml +++ b/roles/mgrote.tmux/tasks/main.yml @@ -28,3 +28,4 @@ if command -v tmux &> /dev/null && [ -z "$TMUX" ]; then tmux attach -t {{ tmux_standardsession_name }} || tmux new -s {{ tmux_standardsession_name }} fi + state: "{{ tmux_auto_attach }}"