diff --git a/examples/example.session.sh b/examples/example.session.sh index 98559c3..5a2faaf 100644 --- a/examples/example.session.sh +++ b/examples/example.session.sh @@ -1,18 +1,16 @@ -# Set custom session name. Default is based on filename. -session_name "Example Session" - -# Set a custom session root. Default is `$HOME`. +# Set a custom session root path. Default is `$HOME`. +# Must be called before `initialize_session`. session_root "~/Documents" -# Create session if it does not already exist. -if initialize_session; then +# 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 # Example of loading an existing window layout. load_window "example" # Example of in-line window definition - window_name "In-line Window" - tmux new-window -t "$session" -n "$window" + new_window "In-line Window" tmux split-window -t "$session:$window.0" -v -p 50 fi diff --git a/examples/example.window.sh b/examples/example.window.sh index 66be6dd..ca43cf6 100644 --- a/examples/example.window.sh +++ b/examples/example.window.sh @@ -1,11 +1,10 @@ -# Set custom window name. Default is based on filename. -window_name "Example Window" - -# Set a window root path. Default is `$session_root`. +# Set window root path. Default is `$session_root`. +# Must be called before `new_window`. window_root "~/Desktop" -# Create new window. Remove if you want to apply layout to current window. -tmux new-window -t "$session" -n "$window" +# Create new window. If no argument is given, window name will be based on +# layout file name. +new_window "Example Window" # Split window into panes. tmux split-window -t "$session:$window.0" -v -p 20 "watch -t date"