diff --git a/ansible/roles/config/files/tmuxp-default.yaml b/ansible/roles/config/files/tmuxp-default.yaml new file mode 100644 index 0000000..54260ed --- /dev/null +++ b/ansible/roles/config/files/tmuxp-default.yaml @@ -0,0 +1,6 @@ +session_name: Default session +start_directory: /home +windows: + - window_name: home + panes: + - echo Welcome to proveasio. To update windows/panes for this session edit ~/.tmuxp/default.yaml. Create new sessions by adding yaml files. See Proveasio usage docs for details. diff --git a/ansible/roles/config/tasks/tmux.yml b/ansible/roles/config/tasks/tmux.yml index 24aece6..5f26e14 100644 --- a/ansible/roles/config/tasks/tmux.yml +++ b/ansible/roles/config/tasks/tmux.yml @@ -15,3 +15,18 @@ # TODO: Add changed_when/failed_when - name: "[Config][Tmux] Update plugins" # noqa no-changed-when ansible.builtin.command: "{{ ansible_env.HOME }}/.tmux/plugins/tpm/bin/update_plugins all" + +- name: "[Config][Tmuxp] Create directory in {{ ansible_env.HOME }}/.tmuxp" + ansible.builtin.file: + path: "{{ ansible_env.HOME }}/.tmuxp" + state: directory + mode: '0755' + +- name: "[Config][Tmuxp] Add default session file" + vars: + app: Tmuxp + source_file: tmuxp-default.yaml + target_file: "{{ ansible_env.HOME }}/.tmuxp/default_session.yaml" + ansible.builtin.include_role: + name: common + tasks_from: config_file.yml diff --git a/docs-web/docs/usage/30-tmux.md b/docs-web/docs/usage/30-tmux.md index 10a48c9..b4127bb 100644 --- a/docs-web/docs/usage/30-tmux.md +++ b/docs-web/docs/usage/30-tmux.md @@ -40,7 +40,9 @@ For the first option - you can simply save your current session (opened windows, You can also have multiple sessions, configured in YAML format, where you define open windows, panes, commands etc. You can define one for each project and easily switch/attach to them. -Sessions are stored in `${HOME}/.tmuxp` directory in a `*.yaml` file. See [`tmuxp`](https://github.com/tmux-python/tmuxp) how to define session. +Sessions are stored in `${HOME}/.tmuxp` directory in a `*.yaml` file. There is a default session file created when running Proveasio (for example purposes). To remove creating that file add `tmuxp_default_session: false` in your `overrides.yml` file. See overriding variables in main documentation. + +See [`tmuxp`](https://github.com/tmux-python/tmuxp) for details on how to define sessions with multiple windows, panes etc. After you define you session(s), you can run `lp` from shell, which will invoke a picker for your sessions. You can either attach it to our current session or create a new one.