From 67b9659cfcb327c173f138f300da76967e360a2d Mon Sep 17 00:00:00 2001 From: Philipp Millar Date: Fri, 20 Mar 2015 12:27:53 +0100 Subject: [PATCH] Load configurations from `.tmux/`. This fixes #6 --- tmux-up | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tmux-up b/tmux-up index 670ea41..4b9039e 100755 --- a/tmux-up +++ b/tmux-up @@ -38,15 +38,17 @@ then exit 0 fi -CONF_DIR=$HOME/.tmux +CONF_DIR=.tmux CONF=${1:-.tmux.conf} -# try default configuration directory +# try local configuration directory [ ! -f "$CONF" ] && CONF="$CONF_DIR/$CONF" +# try default configuration directory +[ ! -f "$CONF" ] && CONF="$HOME/$CONF_DIR/$CONF" if [ ! -f "$CONF" ] then - echo "$0: cannot stat ‘${CONF}’: No such file" + echo "$0: cannot stat ‘${NAME}.conf’: No such file" exit 1 fi @@ -56,7 +58,7 @@ NAME=$(basename "$CONF" .conf) if [ "$NAME" = 'tmux' ] || [ "$NAME" = '.tmux' ] then SESSION=$BASE -elif [ ! -f "${NAME}.conf" ] +elif [ ! -f "${NAME}.conf" ] && [ ! -f "${CONF_DIR}/${NAME}.conf" ] then SESSION=$NAME else