Skip to content

Commit

Permalink
fix(tmuxp): Add default session file for TMUXP
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziwi01 committed Mar 18, 2024
1 parent 16c7bc5 commit 17d36e7
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
6 changes: 6 additions & 0 deletions ansible/roles/config/files/tmuxp-default.yaml
Original file line number Diff line number Diff line change
@@ -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.
15 changes: 15 additions & 0 deletions ansible/roles/config/tasks/tmux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 3 additions & 1 deletion docs-web/docs/usage/30-tmux.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down

0 comments on commit 17d36e7

Please sign in to comment.