updates nvim sessions from tmux to wezterm

This commit is contained in:
2024-08-10 15:20:08 -07:00
parent f58ff37b78
commit 3f34effc6b
10 changed files with 63 additions and 48 deletions

4
sesh
View File

@@ -1,6 +1,8 @@
#!/bin/bash #!/bin/bash
directory=~/linux-setup/tmux-sessions directory=~/linux-setup/sessions
alias wezterm='flatpak run org.wezfurlong.wezterm'
usage() { usage() {
echo "Usage: $0 [-t] <session>" echo "Usage: $0 [-t] <session>"

1
sessions/sync Normal file
View File

@@ -0,0 +1 @@

27
sessions/sync.sh Executable file
View File

@@ -0,0 +1,27 @@
# alias wezterm='flatpak run org.wezfurlong.wezterm'
win=$(flatpak run org.wezfurlong.wezterm cli spawn --new-window)
flatpak run org.wezfurlong.wezterm cli set-window-title --pane-id $win "Syncopotamus"
flatpak run org.wezfurlong.wezterm cli set-tab-title --pane-id $win "Go"
echo "cd ~/repos/syncopotamus-go" | flatpak run org.wezfurlong.wezterm cli send-text --no-paste --pane-id $win
echo "export SYNCOPOTAMUS_BC_CLIENT_ID='de4602c11dcdacfbe8f1a172f84b4e88b7a1adeb'" | flatpak run org.wezfurlong.wezterm cli send-text --no-paste --pane-id $win
echo "export SYNCOPOTAMUS_BC_CLIENT_SECRET='710ddd0ec04c098adca8564e4caab2c7034ad272'" | flatpak run org.wezfurlong.wezterm cli send-text --no-paste --pane-id $win
echo "export SYNCOPOTAMUS_BC_REDIRECT_SERVER='http://localhost'" | flatpak run org.wezfurlong.wezterm cli send-text --no-paste --pane-id $win
echo "clear" | flatpak run org.wezfurlong.wezterm cli send-text --no-paste --pane-id $win
echo "go run ." | flatpak run org.wezfurlong.wezterm cli send-text --no-paste --pane-id $win
pane=$(flatpak run org.wezfurlong.wezterm cli split-pane --left --pane-id $win)
echo "cd ~/repos/syncopotamus-go" | flatpak run org.wezfurlong.wezterm cli send-text --no-paste --pane-id $pane
echo "nvim" | flatpak run org.wezfurlong.wezterm cli send-text --no-paste --pane-id $pane
flatpak run org.wezfurlong.wezterm cli adjust-pane-size --amount 50 --pane-id $pane right
pane=$(flatpak run org.wezfurlong.wezterm cli spawn --pane-id $pane)
flatpak run org.wezfurlong.wezterm cli set-tab-title --pane-id $pane "Svelte"
echo "cd ~/repos/syncopotamus-svelte" | flatpak run org.wezfurlong.wezterm cli send-text --no-paste --pane-id $pane
echo "npm run dev" | flatpak run org.wezfurlong.wezterm cli send-text --no-paste --pane-id $pane
pane=$(flatpak run org.wezfurlong.wezterm cli split-pane --left --pane-id $pane)
echo "cd ~/repos/syncopotamus-svelte" | flatpak run org.wezfurlong.wezterm cli send-text --no-paste --pane-id $pane
echo "nvim" | flatpak run org.wezfurlong.wezterm cli send-text --no-paste --pane-id $pane
flatpak run org.wezfurlong.wezterm cli adjust-pane-size --amount 50 --pane-id $pane right

20
sessions/syncrails.sh Executable file
View File

@@ -0,0 +1,20 @@
# alias wezterm='flatpak run org.wezfurlong.wezterm'
PANE=$(flatpak run org.wezfurlong.wezterm cli list | grep syncopotamus | head -n 1 | awk '{print $3}')
if [ -n "${PANE}" ]; then
PANE=$(flatpak run org.wezfurlong.wezterm cli spawn --pane-id $PANE)
echo "Opening Rails in existing window"
else
PANE=$(flatpak run org.wezfurlong.wezterm cli spawn --new-window)
echo "Opening Rails in new window"
fi
flatpak run org.wezfurlong.wezterm cli set-tab-title --pane-id $PANE "Rails"
echo "cd ~/repos/syncopotamus-rails" | flatpak run org.wezfurlong.wezterm cli send-text --no-paste --pane-id $PANE
echo "rails s" | flatpak run org.wezfurlong.wezterm cli send-text --no-paste --pane-id $PANE
PANE=$(flatpak run org.wezfurlong.wezterm cli split-pane --left --pane-id $PANE)
echo "cd ~/repos/syncopotamus-rails" | flatpak run org.wezfurlong.wezterm cli send-text --no-paste --pane-id $PANE
echo "nvim" | flatpak run org.wezfurlong.wezterm cli send-text --no-paste --pane-id $PANE
flatpak run org.wezfurlong.wezterm cli adjust-pane-size --amount 50 --pane-id $PANE right

View File

@@ -1,20 +0,0 @@
tmux new-session -s syncopotamus -d -c ~/repos/syncopotamus-go -n backend
tmux set-environment -t syncopotamus SYNCOPOTAMUS_BC_CLIENT_ID "de4602c11dcdacfbe8f1a172f84b4e88b7a1adeb"
tmux set-environment -t syncopotamus SYNCOPOTAMUS_BC_CLIENT_SECRET "710ddd0ec04c098adca8564e4caab2c7034ad272"
tmux set-environment -t syncopotamus SYNCOPOTAMUS_BC_REDIRECT_SERVER "http://localhost"
tmux split-window -h -c ~/repos/syncopotamus-go
tmux resize-pane -t syncopotamus:backend.0 -x 90%
tmux send-keys -t syncopotamus:backend.0 'nvim' C-m
tmux send-keys -t syncopotamus:backend.1 'go run .' C-m
tmux new-window -c ~/repos/syncopotamus-svelte -n svelte
tmux split-window -h -c ~/repos/syncopotamus-svelte
tmux resize-pane -t syncopotamus:svelte.0 -x 90%
tmux send-keys -t syncopotamus:svelte.0 'nvim' C-m
tmux send-keys -t syncopotamus:svelte.1 'npm run dev' C-m
tmux select-window -t syncopotamus:backend
tmux select-pane -t 0
tmux -2 attach-session -t syncopotamus

View File

@@ -1,15 +0,0 @@
tmux new-session -s syncopotamus -d
tmux new-window -c ~/repos/syncopotamus-rails -n rails
tmux set-environment -t syncopotamus SYNCOPOTAMUS_BC_CLIENT_ID "de4602c11dcdacfbe8f1a172f84b4e88b7a1adeb"
tmux set-environment -t syncopotamus SYNCOPOTAMUS_BC_CLIENT_SECRET "710ddd0ec04c098adca8564e4caab2c7034ad272"
tmux set-environment -t syncopotamus SYNCOPOTAMUS_BC_REDIRECT_SERVER "http://localhost"
tmux split-window -h -c ~/repos/syncopotamus-rails
tmux resize-pane -t syncopotamus:rails.0 -x 90%
tmux send-keys -t syncopotamus:rails.0 'nvim' C-m
tmux send-keys -t syncopotamus:rails.1 'rails s' C-m
tmux select-window -t syncopotamus:rails
tmux select-pane -t 0
tmux -2 attach-session -t syncopotamus