From 00fe271f3494005930a557adfb596e0a11782fb8 Mon Sep 17 00:00:00 2001 From: dabruh <11458706-dabruh@users.noreply.gitlab.com> Date: Mon, 28 Aug 2023 16:42:02 +0200 Subject: [PATCH] Add comments --- .local/bin/t | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.local/bin/t b/.local/bin/t index 9597112..bba3c0c 100755 --- a/.local/bin/t +++ b/.local/bin/t @@ -1,6 +1,14 @@ #!/bin/bash +# TITLE : t +# DESCRIPTION : Creates and re-opens tmux sessions +# AUTHOR : edabrows +# DATE : 20230828 +# VERSION : 0.1.0 +# USAGE : t +# BASH_VERSION : 5.1.16(1)-release + EXISTS=false -tmux ls | cut -d: -f1 | grep -q "^${1:?}$" && EXISTS=true -$EXISTS && tmux a -t "$1" -$EXISTS || tmux new -s "$1" +tmux ls | cut -d: -f1 | grep -q "^${1:?}$" && EXISTS=true # Get open sessions +$EXISTS && tmux a -t "$1" # Attatch to existing session +$EXISTS || tmux new -s "$1" # Create a new session