diff --git a/README.md b/README.md index a71d30a..d45ed7a 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/examples/example.session.sh b/examples/example.session.sh index b4a8491..4517758 100644 --- a/examples/example.session.sh +++ b/examples/example.session.sh @@ -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