updates sessions to split opening with and without a specific terminal

This commit is contained in:
2024-03-23 11:32:10 -07:00
parent 5100b6bfe1
commit 2974df409a
5 changed files with 46 additions and 9 deletions

29
sesh
View File

@@ -1,10 +1,31 @@
#!/bin/bash
directory=~/linux-setup/tmux-sessions
usage() {
echo "Usage: $0 [-t] <session>"
echo " -t: Add <session>"
exit 1
}
# Check if no parameter is provided
if [ $# -eq 0 ]; then
usage
fi
# Check for optional flag
if [ "$1" == "-t" ]; then
# Check if no session parameter is provided after the flag
if [ $# -lt 2 ]; then
usage
fi
flatpak run org.wezfurlong.wezterm start $directory/$2.sh
else
exec "$directory/$1.sh"
fi
# Check if no parameter is provided
if [ $# -eq 0 ]; then
echo "Error: No parameter provided. Please provide a session."
exit 1
fi
# Echo the provided session parameter
echo "Session: $1"
flatpak run org.wezfurlong.wezterm start ~/linux-setup/tmux-sessions/$1.sh