diff options
| author | Kyren223 <Kyren223@proton.me> | 2024-11-28 11:27:55 +0200 |
|---|---|---|
| committer | Kyren223 <Kyren223@proton.me> | 2024-11-28 11:27:55 +0200 |
| commit | ef48ce7a9e559dfe4ef685910d293b78074ff1f2 (patch) | |
| tree | 81daa4b300c4e4b7b8d0e63e12632856b10becc3 /scripts/tmux-session-setup | |
| parent | 2eece72a6374eb048205a826ce7925000f1a844a (diff) | |
Added scripts to path, added tmux-sessionizer it's so great, and also an
auto setup for projects (and specific ones aswell like eko)
Diffstat (limited to 'scripts/tmux-session-setup')
| -rwxr-xr-x | scripts/tmux-session-setup | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/scripts/tmux-session-setup b/scripts/tmux-session-setup new file mode 100755 index 0000000..835e2c5 --- /dev/null +++ b/scripts/tmux-session-setup @@ -0,0 +1,26 @@ +#!/usr/bin/env bash + +sess=$1 +dir=$2 + +if [ "$sess" = "eko" ]; then + tmux rename-window -t $sess:1 editor + tmux send-keys -t $sess:editor.1 "vim" C-m + + tmux new-window -t $sess -n app -c $dir + tmux split-window -t $sess:app.1 -v -c $dir + tmux send-keys -t $sess:app.2 "watchexec --exts=go './reload.sh'" C-m + tmux resize-pane -Z -t $sess:app.1 + + tmux new-window -t $sess -n logs -c $dir + tmux split-window -t $sess:logs.1 -h -c $dir + tmux split-window -t $sess:logs.2 -v -c $dir + tmux send-keys -t $sess:logs.1 "tail -f messages.log" C-m + tmux send-keys -t $sess:logs.2 "tail -f client.log" C-m + tmux send-keys -t $sess:logs.3 "go run ./cmd/server --stdout" C-m + + tmux select-window -t $sess:editor +elif [[ "$dir" == "$HOME/projects/"* ]]; then + tmux rename-window -t $sess:1 editor + tmux send-keys -t $sess:editor.1 "vim" C-m +fi |
