| Crates.io | tmux-layout |
| lib.rs | tmux-layout |
| version | 0.1.0 |
| created_at | 2025-03-09 11:08:16.291095+00 |
| updated_at | 2025-03-09 11:08:16.291095+00 |
| description | A tool for managing tmux sessions with predefined layouts |
| homepage | https://github.com/dsmatter/tmux-layout-rs |
| repository | https://github.com/dsmatter/tmux-layout-rs |
| max_upload_size | |
| id | 1585369 |
| size | 128,119 |
A tool for managing tmux sessions with predefined layouts. Define your tmux workspace layouts in YAML/TOML configuration files and easily recreate them.
cargo install tmux-layout
.tmux-layout.yaml in your home directory or current directory:sessions:
- name: dev
windows:
- name: editor
cwd: ~/projects/myapp
left:
width: 60%
shell_command: nvim
active: true
right:
top:
height: 70%
shell_command: cargo watch -x test
bottom:
send_keys:
- git status
- Enter
- name: server
cwd: ~/projects/server
windows:
- name: logs
cwd: logs
shell_command: tail -f app.log
tmux-layout create
Export your current tmux layout to a configuration file:
# Export all sessions
tmux-layout export > my-layout.yaml
# Export current session only
tmux-layout export --scope session > session.yaml
# Export current window only
tmux-layout export --scope window > window.yaml
SUBCOMMANDS:
create Create tmux layout from config file
dump-command Dump tmux command to stdout
dump-config Dump config to stdout
export Exports running tmux sessions into config file format
help Print this message or the help of the given subcommand(s)
COMMON OPTIONS (run subcommand with --help to see all options):
-c, --config <FILE> Config file path
-f, --format <FORMAT> Export config format [yaml, toml]
-m, --session-select-mode <MODE> Session select mode [auto, attach, switch, detached]
-i, --ignore-existing-sessions Don't create already existing tmux sessions
The configuration file can be in YAML or TOML format. The basic structure is:
# Optional list of other config files to include
includes:
- ~/other-layout.yaml
# Optional session to select after creation
selected_session: dev
# List of sessions to create
sessions:
- name: session-name
cwd: ~/base/path # Base working directory for all windows
windows:
- name: window-name
cwd: sub/path # Relative to session cwd
active: true # Make this the active window
# Window layout splits
left:
width: 30% # Width of left pane
cwd: ~/path # Working directory for this pane
shell_command: nvim # Command to run in pane
send_keys: # Keys to send to pane
- ":Ex"
- Enter
right:
top:
height: 70% # Height of top pane
actve: true # Make this the active pane
bottom:
shell_command: git status
# List of standalone windows (created in current session)
windows:
- name: standalone
cwd: ~/somewhere
MIT