Files
tmuxifier/libexec/tmuxifier-load-session

34 lines
673 B
Bash
Executable File

#! /usr/bin/env bash
set -e
[ -n "$TMUXIFIER_DEBUG" ] && set -x
# Provide tmuxifier help
if [ "$1" == "--help" ]; then
echo "usage: tmuxifier load-session <layout_name>
Aliases: session, ses, s
Create a session using the session layout, unless the session already exists
in which case, we simply attach/switch to the existing one."
exit
fi
# Provide tmuxifier completions
if [ "$1" == "--complete" ]; then
for item in $(tmuxifier-list-sessions); do
echo "$item"
done
exit
fi
if [ -z "$1" ]; then
echo "$(tmuxifier-help load-session)" >&2
exit 1
fi
# Load runtime functions.
source "$TMUXIFIER/lib/runtime.sh"
# Load session file.
load_session "$1"