scripts

Personal scripts that don't fit elsewhere

git clone https://code.pdelong.com/scripts.git

 1#!/bin/bash
 2
 3# A simple script to speed up connecting to/creating tmux sessions.
 4#
 5# If the given workspace exists, connect to it.  Otherwise, create it.
 6
 7if ! command -v tmux; then
 8	echo 'Please install tmux'
 9	exit 1
10fi
11
12if [[ $# -eq 0 ]]; then
13	workspace='default'
14elif [[ $# -eq 1 ]]; then
15	workspace="$1"
16else
17	echo 'usage: t <WORKSPACE>'
18fi
19
20exec tmux new-session -A -s "$workspace"