tmux auto attach (#180)

tmux auto attach

Co-authored-by: Michael Grote <michael.grote@posteo.de>
Reviewed-on: mg/ansible#180
Co-Authored-By: mg <mg@noreply.git.mgrote.net>
Co-Committed-By: mg <mg@noreply.git.mgrote.net>
This commit is contained in:
Michael Grote 2021-07-30 07:40:30 +02:00
parent a3a5cdd1a0
commit 31e5d189c5
3 changed files with 4 additions and 0 deletions

View file

@ -1,4 +1,6 @@
--- ---
### mgrote.tmux
tmux_auto_attach: absent
### mgrote.dotfiles ### mgrote.dotfiles
dotfiles_repo_url: https://git.mgrote.net/mg/dotfiles dotfiles_repo_url: https://git.mgrote.net/mg/dotfiles
dotfiles_repo_path: /home/mg/dotfiles dotfiles_repo_path: /home/mg/dotfiles

View file

@ -2,3 +2,4 @@
tmux_conf_destination: "/home/mg/.tmux.conf" tmux_conf_destination: "/home/mg/.tmux.conf"
tmux_bashrc_destination: "/home/mg/.bashrc" tmux_bashrc_destination: "/home/mg/.bashrc"
tmux_standardsession_name: "default" tmux_standardsession_name: "default"
tmux_auto_attach: present # or absent; soll bei jedem shell-start automatisch eine tmux session erstellt oder attached werden

View file

@ -28,3 +28,4 @@
if command -v tmux &> /dev/null && [ -z "$TMUX" ]; then if command -v tmux &> /dev/null && [ -z "$TMUX" ]; then
tmux attach -t {{ tmux_standardsession_name }} || tmux new -s {{ tmux_standardsession_name }} tmux attach -t {{ tmux_standardsession_name }} || tmux new -s {{ tmux_standardsession_name }}
fi fi
state: "{{ tmux_auto_attach }}"