mirror of
https://github.com/jimeh/tmuxifier.git
synced 2026-02-19 09:56:39 +00:00
* `session` and `window` commands are now know as `load-session` and `load-window` respectively, with aliases for their former names. * Add short aliases for various commands. * `help` and `completions` commands have been expanded with support for aliases. * `help` command has been expanded upon with brief docs for a few more commands.
29 lines
658 B
Bash
Executable File
29 lines
658 B
Bash
Executable File
#! /usr/bin/env bash
|
|
set -e
|
|
[ -n "$TMUXIFIER_DEBUG" ] && set -x
|
|
|
|
if [ -z "$1" ]; then
|
|
echo "usage: tmuxifier new-session <layout_name>" >&2
|
|
exit 1
|
|
fi
|
|
|
|
layout_name="$1"
|
|
layout_file="$TMUXIFIER_LAYOUT_PATH/${layout_name}.session.sh"
|
|
template="$TMUXIFIER/templates/session.sh"
|
|
|
|
if [ ! -f "$template" ]; then
|
|
echo "tmuxifier: session layout template not found: $template" >&2
|
|
exit 1
|
|
fi
|
|
|
|
if [ -f "$layout_file" ]; then
|
|
echo "session layout '$layout_name' already exists." >&2
|
|
echo "" >&2
|
|
echo "You can edit it with:" >&2
|
|
echo " tmuxifier edit-session \"$layout_name\"" >&2
|
|
exit 1
|
|
fi
|
|
|
|
cp "$template" "$layout_file"
|
|
exec "$EDITOR" "$layout_file"
|