Last active
August 2, 2022 15:53
-
-
Save ludofleury/953baf680819a8fff6f5a1a1f5c07eec to your computer and use it in GitHub Desktop.
"automate my splitting of iterm windows and opening of docker-compose logs of my applications. You can use osascript to do that which will execute AppleScript" by Anne-Sophie (https://github.com/tanguy-a)
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
#!/bin/bash | |
osascript<<EOF | |
tell application "iTerm" | |
activate | |
select first window | |
# Create new tab | |
tell current window | |
create tab with default profile | |
end tell | |
# Split pane | |
tell current session of current window | |
split horizontally with default profile | |
end tell | |
# Run command in Pane-1 | |
tell first session of current tab of current window | |
write text "ext" | |
write text "docker-compose -f docker-compose.yml -f titi.yml logs -f titi" | |
end tell | |
# Run command in Pane-2 | |
tell second session of current tab of current window | |
write text "ext" | |
write text "docker-compose -f docker-compose.yml -f toto.yml logs -f toto" | |
end tell | |
end tell | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment