aboutsummaryrefslogtreecommitdiff
path: root/bin/tm.sh
diff options
context:
space:
mode:
Diffstat (limited to 'bin/tm.sh')
-rw-r--r--bin/tm.sh9
1 files changed, 7 insertions, 2 deletions
diff --git a/bin/tm.sh b/bin/tm.sh
index d5422869..6bdce20b 100644
--- a/bin/tm.sh
+++ b/bin/tm.sh
@@ -1,5 +1,10 @@
# Attach to existing tmux session rather than create a new one if possible
+# Source config if it exists (just the session name, really)
+if [ -e "${XDG_CONFIG_HOME:-"$HOME"/.config}"/tm/config ] ; then
+ . "${XDG_CONFIG_HOME:-"$HOME"/.config}"/tm/config || exit
+fi
+
# If given any arguments, just use them as they are
if [ "$#" -gt 0 ] ; then
:
@@ -10,8 +15,8 @@ elif tmux has-session 2>/dev/null ; then
# Create a new session with an appropriate name
else
- set -- new-session -s "${TMUX_SESSION:-default}"
+ set -- new-session -s "${default_session_name:-default}"
fi
# Execute with concluded arguments
-tmux "$@"
+exec tmux "$@"