Files
tmuxifier/runtime.sh
Jim Myhrberg d2122044ee Make layout API-interface a bit simpler
Additionally, also fix a bug when creating a window, where as if the
session name was the same as a window that already existed, it would
fail, accidentally using the window rather than the session at a target.
2012-04-25 00:25:11 +01:00

37 lines
560 B
Bash

#
# Load up runtime environment for session and window layout files.
#
# Load tmuxifier environment.
source "$TMUXIFIER/env.sh"
# Setup default variables.
session_root="$HOME"
# Load layout helper functions.
source "$TMUXIFIER/layout-helpers.sh"
#
# Internal functions
#
# Expands given path.
#
# Example:
#
# $ __expand_path "~/Projects"
# /Users/jimeh/Projects
#
__expand_path() {
echo $(eval echo "$@")
}
__go_to_session() {
if [ -z $TMUX ]; then
tmux -u attach-session -t "$session"
else
tmux -u switch-client -t "$session"
fi
}