8 Commits

Author SHA1 Message Date
966e500b40 Bump version to 0.8.1 2013-07-17 14:43:17 +01:00
4c1cb0762a Fix issue #23 - Some consoles don't seem to support C-l 2013-07-17 14:42:46 +01:00
a7473208c0 Bump version to 0.8.0 2013-07-02 23:06:03 +02:00
1dddbb502c Enable load commands to accept file paths in addition to layout names
Resolves issue #20. Additionally, load_session now has an optional
second argument to set the default session name. And error output from
both load commands is now printed to STDERR and give a return code of 1
on error.
2013-07-02 23:05:18 +02:00
da1354d5b7 Bump version to 0.7.3 2013-06-27 08:56:40 +02:00
f01c789de4 Fix typo 2013-06-27 08:55:43 +02:00
b52ef20be8 Merge pull request #22 from limeyd/master
Add optional window name when loading windows
2013-06-26 23:54:38 -07:00
limeyd
212693b1e9 added optional window name 2013-06-26 20:55:29 -06:00
5 changed files with 36 additions and 13 deletions

View File

@@ -143,12 +143,22 @@ window_root() {
# Load specified window layout.
#
# Arguments:
# - $1: Name of window layout to load.
# - $1: Name of or file path to window layout to load.
# - $2: (optional) Override default window name.
#
load_window() {
local file="$TMUXIFIER_LAYOUT_PATH/$1.window.sh"
local file="$1"
if [ ! -f "$file" ]; then
file="$TMUXIFIER_LAYOUT_PATH/$1.window.sh"
fi
if [ -f "$file" ]; then
window="$1"
if [ $# -gt 1 ]; then
window="$2"
else
window="${1/%.window.sh}"
window="${window/%.sh}"
fi
source "$file"
window=
@@ -157,19 +167,31 @@ load_window() {
window_root "$session_root"
fi
else
echo "No such window layout found '$1' in '$TMUXIFIER_LAYOUT_PATH'."
echo "\"$1\" window layout not found." >&2
return 1
fi
}
# Load specified session layout.
#
# Arguments:
# - $1: Name of session layout to load.
# - $1: Name of or file path to session layout to load.
# - $2: (optional) Override default window name.
#
load_session() {
local file="$TMUXIFIER_LAYOUT_PATH/$1.session.sh"
local file="$1"
if [ ! -f "$file" ]; then
file="$TMUXIFIER_LAYOUT_PATH/$1.session.sh"
fi
if [ -f "$file" ]; then
session="$1"
if [ $# -gt 1 ]; then
session="$2"
else
session="${1/%.session.sh}"
session="${session/%.sh}"
fi
set_default_path=true
source "$file"
session=
@@ -179,7 +201,8 @@ load_session() {
session_root="$HOME"
fi
else
echo "No such session layout found '$1' in '$TMUXIFIER_LAYOUT_PATH'."
echo "\"$1\" session layout not found." >&2
return 1
fi
}
@@ -283,6 +306,6 @@ __go_to_window_or_session_path() {
local window_or_session_root=${window_root-$session_root}
if [ -n "$window_or_session_root" ]; then
run_cmd "cd \"$window_or_session_root\""
send_keys "C-l"
run_cmd "clear"
fi
}

View File

@@ -4,7 +4,7 @@ set -e
# Set shell to first argument that is not "-", "-h" or "--help".
for arg in "$@"; do
if [ "$arg" != "-" ] &&[ "$arg" != "-h" ] && [ "$arg" != "--help" ]; then
if [ "$arg" != "-" ] && [ "$arg" != "-h" ] && [ "$arg" != "--help" ]; then
shell="$arg"
fi
done

View File

@@ -7,7 +7,7 @@ source "$TMUXIFIER/lib/util.sh"
# Provide tmuxifier help
if calling-help "$@"; then
echo "usage: tmuxifier load-session <layout_name>
echo "usage: tmuxifier load-session <layout_name | file_path>
Aliases: session, ses, s

View File

@@ -7,7 +7,7 @@ source "$TMUXIFIER/lib/util.sh"
# Provide tmuxifier help
if calling-help "$@"; then
echo "usage: tmuxifier load-window <layout_name>
echo "usage: tmuxifier load-window <layout_name | file_path>
Aliases: window, win, w

View File

@@ -13,4 +13,4 @@ Outputs Tmuxifier version."
exit
fi
echo "0.7.2"
echo "0.8.1"