Created
September 4, 2023 12:07
-
-
Save pablotrianda/7eed2c32859e646f78d7157ce5ce3242 to your computer and use it in GitHub Desktop.
Bash script to launch a new tmux session with 2 windows
This file contains hidden or 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
#!/bin/bash | |
# Create a new session called "π»π₯" | |
tmux new-session -d -s π»π₯ | |
# Crate the first window and run vim | |
tmux new-window -t π»π₯:1 -n "NOTES" | |
#Open vim with the last note | |
tmux send-keys "v ~/Notes/$(ls /home/pablo/Notes | sort | tail -n 1)/$(ls ~/Notes/$(ls /home/pablo/Notes | sort | tail -n 1) | sort | tail -n 1)" C-m | |
# Crate the second one | |
tmux new-window -t π»π₯:2 -n "BACKEND" | |
# Chage to work directory | |
tmux send-keys "mbody" C-m | |
# Ejecutar htop en el panel de abajo | |
tmux send-keys "files" C-m | |
# Split second window | |
tmux split-window -v -t π»π₯:2 | |
# Chage to work directory | |
tmux send-keys "mbody" C-m | |
# Clean window | |
tmux send-keys "clear" C-m | |
# Chage focus to the fisrt window | |
tmux select-window -t π»π₯:1 | |
# Attach to the new session | |
tmux attach -t π»π₯ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment