Reorganize functions a bit

This commit is contained in:
2012-05-24 00:00:16 +01:00
parent a8ff37808a
commit ae70bae022

View File

@@ -29,6 +29,30 @@ select_window() {
tmux select-window -t "$session:$1"
}
# Cusomize session root path. Default is `$HOME`.
#
# Arguments:
# - $1: Directory path to use for session root.
#
session_root() {
local dir="$(__expand_path $@)"
if [ -d "$dir" ]; then
session_root="$dir"
fi
}
# Customize window root path. Default is `$session_root`.
#
# Arguments:
# - $1: Directory path to use for window root.
#
window_root() {
local dir="$(__expand_path $@)"
if [ -d "$dir" ]; then
window_root="$dir"
fi
}
# Load specified window layout.
#
# Arguments:
@@ -71,30 +95,6 @@ load_session() {
fi
}
# Cusomize session root path. Default is `$HOME`.
#
# Arguments:
# - $1: Directory path to use for session root.
#
session_root() {
local dir="$(__expand_path $@)"
if [ -d "$dir" ]; then
session_root="$dir"
fi
}
# Customize window root path. Default is `$session_root`.
#
# Arguments:
# - $1: Directory path to use for window root.
#
window_root() {
local dir="$(__expand_path $@)"
if [ -d "$dir" ]; then
cd "$dir"
fi
}
# Create a new session, returning 0 on success, 1 on failure.
#
# Arguments: