-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e36d148
commit 56f40d8
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/usr/bin/env bash | ||
|
||
SESSION_NAME="alteza_work_session" | ||
|
||
mkdir -p test_output/ | ||
|
||
# Check if the session already exists | ||
if tmux has-session -t $SESSION_NAME 2>/dev/null; then | ||
echo "Session $SESSION_NAME already exists. Attaching to it." | ||
tmux attach-session -t $SESSION_NAME | ||
else | ||
# Create a new session and name it | ||
tmux new-session -d -s $SESSION_NAME | ||
|
||
# Split the window horizontally | ||
tmux split-window -v -l 20% | ||
|
||
# Send a command to the first pane | ||
tmux send-keys -t 0 'cd test_output; python3 -m http.server 1234' C-m | ||
|
||
# Send a command to the second pane | ||
tmux send-keys -t 1 'source venv/bin/activate.fish' C-m | ||
|
||
tmux swap-pane -s 0 -t 1 | ||
|
||
# Attach to the created session | ||
tmux attach-session -t $SESSION_NAME | ||
fi | ||
|