Skip to content

Commit

Permalink
Load configurations from .tmux/. This fixes jamesottaway#6
Browse files Browse the repository at this point in the history
  • Loading branch information
poxar committed Mar 20, 2015
1 parent 85fa194 commit 67b9659
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tmux-up
Original file line number Diff line number Diff line change
Expand 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

Expand All @@ -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
Expand Down

0 comments on commit 67b9659

Please sign in to comment.