mirror of
https://github.com/jimeh/tmuxifier.git
synced 2026-02-19 01:46:40 +00:00
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.
37 lines
560 B
Bash
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
|
|
}
|