From cd3f7039993d79c2bac3bf20eeba1523dfa364d4 Mon Sep 17 00:00:00 2001 From: Matheus Albino Date: Sun, 23 Jun 2024 04:50:52 -0300 Subject: [PATCH] Adds tn.sh script for tmux session creation --- scripts/shell/tn.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 scripts/shell/tn.sh diff --git a/scripts/shell/tn.sh b/scripts/shell/tn.sh new file mode 100755 index 0000000..e4d5b51 --- /dev/null +++ b/scripts/shell/tn.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +DIR_NAME=${PWD##*/} + +tmux has-session -t $DIR_NAME 2>/dev/null +if [ $? -eq 1 ]; then + tmux new -s $DIR_NAME +else + echo "Session with current dirname was found. The script will exit now..." + exit 1 +fi