Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,36 @@ select_pane 0
You can then load that window layout into a new window in the
current tmux session using:

tmuxifier load-window example
tmuxifier load-window example.window.sh

Which will yield a Tmux window looking like this:

![example](https://github.com/jimeh/tmuxifier/raw/master/examples/example.window-screenshot.png)


We have a session layout file called [example.session.sh][] which
looks like:

[example.session.sh]: https://github.com/jimeh/tmuxifier/blob/master/examples/example.session.sh


```bash
session_root "~/Documents"
if initialize_session "Session Name"; then
new_window "window 1"
run_cmd "pwd"
split_h 50
new_window "window 2"
run_cmd "top"
fi
finalize_and_go_to_session
```

You can then load that session layout into a new session in the
tmux using:

tmuxifier load-session example.session.sh

## Installation

Clone the repo to your machine:
Expand Down
15 changes: 6 additions & 9 deletions examples/example.session.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,14 @@ session_root "~/Documents"

# Create session with specified name if it does not already exist. If no
# argument is given, session name will be based on layout file name.
if initialize_session "Example Session"; then
if initialize_session "Session Name"; then

# Create a new window inline within session layout definition.
new_window "In-line Window"
tmux split-window -t "$session:$window.0" -v -p 50

# Load a defined window layout.
load_window "example"

# Select the default active window on session creation.
select_window 0
new_window "window 1"
run_cmd "pwd"
split_h 50
new_window "window 2"
run_cmd "top"

fi

Expand Down