From 27fdd96a28e74c3d09b2ddf979b561c5efb78c7e Mon Sep 17 00:00:00 2001 From: Carlos Aldana Date: Fri, 15 Nov 2024 06:47:08 -0800 Subject: [PATCH] updates sesh names, and changes rails sesh to use bin/dev --- sessions/sync.sh | 47 ++++++++++++++++++++----------------------- sessions/syncprev.sh | 31 ++++++++++++++++++++++++++++ sessions/syncrails.sh | 28 -------------------------- 3 files changed, 53 insertions(+), 53 deletions(-) create mode 100755 sessions/syncprev.sh delete mode 100755 sessions/syncrails.sh diff --git a/sessions/sync.sh b/sessions/sync.sh index fa7cef7..9c7687a 100755 --- a/sessions/sync.sh +++ b/sessions/sync.sh @@ -1,31 +1,28 @@ -# alias wezterm='flatpak run org.wezfurlong.wezterm' +PANE=$(flatpak run org.wezfurlong.wezterm cli list | grep syncopotamus | head -n 1 | awk '{print $3}') -flatpak run org.wezfurlong.wezterm cli set-window-title "syncopotamus" +if [ -n "${PANE}" ]; then + PANE=$(flatpak run org.wezfurlong.wezterm cli spawn --pane-id $PANE) + echo "Opening Rails in existing window" + flatpak run org.wezfurlong.wezterm cli set-tab-title --pane-id $PANE "Rails" + echo "cd ~/repos/syncopotamus" | flatpak run org.wezfurlong.wezterm cli send-text --no-paste --pane-id $PANE + # echo "rvm use 3.3.1" | flatpak run org.wezfurlong.wezterm cli send-text --no-paste --pane-id $PANE + echo "bin/dev" | flatpak run org.wezfurlong.wezterm cli send-text --no-paste --pane-id $PANE + PANE=$(flatpak run org.wezfurlong.wezterm cli split-pane --top --pane-id $PANE) +else + echo "Opening Rails in this window" + flatpak run org.wezfurlong.wezterm cli set-tab-title "Rails" + echo "cd ~/repos/syncopotamus" | flatpak run org.wezfurlong.wezterm cli send-text --no-paste + echo "clear" | flatpak run org.wezfurlong.wezterm cli send-text --no-paste + # echo "rvm use 3.3.1" | flatpak run org.wezfurlong.wezterm cli send-text --no-paste + echo "bin/dev" | flatpak run org.wezfurlong.wezterm cli send-text --no-paste + PANE=$(flatpak run org.wezfurlong.wezterm cli split-pane --top) +fi -flatpak run org.wezfurlong.wezterm cli set-tab-title "Go" -echo "cd ~/repos/syncopotamus-go" | flatpak run org.wezfurlong.wezterm cli send-text --no-paste -echo "export SYNCOPOTAMUS_BC_CLIENT_ID='de4602c11dcdacfbe8f1a172f84b4e88b7a1adeb'" | flatpak run org.wezfurlong.wezterm cli send-text --no-paste -echo "export SYNCOPOTAMUS_BC_CLIENT_SECRET='710ddd0ec04c098adca8564e4caab2c7034ad272'" | flatpak run org.wezfurlong.wezterm cli send-text --no-paste -echo "export SYNCOPOTAMUS_BC_REDIRECT_SERVER='http://localhost'" | flatpak run org.wezfurlong.wezterm cli send-text --no-paste -echo "clear" | flatpak run org.wezfurlong.wezterm cli send-text --no-paste -echo "go run ." | flatpak run org.wezfurlong.wezterm cli send-text --no-paste - -pane=$(flatpak run org.wezfurlong.wezterm cli split-pane --left) -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 +echo "cd ~/repos/syncopotamus" | 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 20 --pane-id $PANE down if [ "$1" == "web" ]; then firefox https://3.basecamp.com/5456546/buckets/34127086/card_tables/6496384013 & - firefox --new-window http://localhost:5173/user/noisycarlos/dashboard & + firefox --new-window http://localhost:4000 & fi diff --git a/sessions/syncprev.sh b/sessions/syncprev.sh new file mode 100755 index 0000000..fa7cef7 --- /dev/null +++ b/sessions/syncprev.sh @@ -0,0 +1,31 @@ +# alias wezterm='flatpak run org.wezfurlong.wezterm' + +flatpak run org.wezfurlong.wezterm cli set-window-title "syncopotamus" + +flatpak run org.wezfurlong.wezterm cli set-tab-title "Go" +echo "cd ~/repos/syncopotamus-go" | flatpak run org.wezfurlong.wezterm cli send-text --no-paste +echo "export SYNCOPOTAMUS_BC_CLIENT_ID='de4602c11dcdacfbe8f1a172f84b4e88b7a1adeb'" | flatpak run org.wezfurlong.wezterm cli send-text --no-paste +echo "export SYNCOPOTAMUS_BC_CLIENT_SECRET='710ddd0ec04c098adca8564e4caab2c7034ad272'" | flatpak run org.wezfurlong.wezterm cli send-text --no-paste +echo "export SYNCOPOTAMUS_BC_REDIRECT_SERVER='http://localhost'" | flatpak run org.wezfurlong.wezterm cli send-text --no-paste +echo "clear" | flatpak run org.wezfurlong.wezterm cli send-text --no-paste +echo "go run ." | flatpak run org.wezfurlong.wezterm cli send-text --no-paste + +pane=$(flatpak run org.wezfurlong.wezterm cli split-pane --left) +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 + +if [ "$1" == "web" ]; then + firefox https://3.basecamp.com/5456546/buckets/34127086/card_tables/6496384013 & + firefox --new-window http://localhost:5173/user/noisycarlos/dashboard & +fi diff --git a/sessions/syncrails.sh b/sessions/syncrails.sh deleted file mode 100755 index 17a4c4c..0000000 --- a/sessions/syncrails.sh +++ /dev/null @@ -1,28 +0,0 @@ -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" - flatpak run org.wezfurlong.wezterm cli set-tab-title --pane-id $PANE "Rails" - echo "cd ~/repos/syncopotamus" | flatpak run org.wezfurlong.wezterm cli send-text --no-paste --pane-id $PANE - # echo "rvm use 3.3.1" | 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 --top --pane-id $PANE) -else - echo "Opening Rails in this window" - flatpak run org.wezfurlong.wezterm cli set-tab-title "Rails" - echo "cd ~/repos/syncopotamus" | flatpak run org.wezfurlong.wezterm cli send-text --no-paste - echo "clear" | flatpak run org.wezfurlong.wezterm cli send-text --no-paste - # echo "rvm use 3.3.1" | flatpak run org.wezfurlong.wezterm cli send-text --no-paste - echo "rails s" | flatpak run org.wezfurlong.wezterm cli send-text --no-paste - PANE=$(flatpak run org.wezfurlong.wezterm cli split-pane --top) -fi - -echo "cd ~/repos/syncopotamus" | 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 20 --pane-id $PANE down - -if [ "$1" == "web" ]; then - firefox https://3.basecamp.com/5456546/buckets/34127086/card_tables/6496384013 & - firefox --new-window http://localhost:4000 & -fi