Created
December 25, 2014 14:50
-
-
Save lululau/7e96dac4572b63236bf5 to your computer and use it in GitHub Desktop.
Let shells in each pane of each tab of each window of iTerm2 to start in a pre-configured cwd and execute commands
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
| w0t0p2: | |
| dir: "~" | |
| commands: | |
| - pry | |
| w0t1p0: | |
| dir: "~/a/" | |
| w0t1p1: | |
| dir: "~/a/" | |
| w0t1p2: | |
| dir: "~/b/" | |
| w0t1p3: | |
| dir: "~/c/" | |
| w0t2p0: | |
| dir: "~/c" | |
| w0t2p1: | |
| dir: "~/d" | |
| w0t2p4: | |
| dir: "~/tmp" | |
| w0t5p2: | |
| dir: "~/cascode/clojure/" |
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
| if [ -n "$ITERM_SESSION_ID" ] | |
| then | |
| eval "$(icrt.rb "$ITERM_SESSION_ID")" | |
| fi |
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
| #!/usr/bin/env ruby | |
| require 'yaml' | |
| if (config = YAML.load(IO.read(File.expand_path("~/.icrt.yaml")))[ARGV.first]) != nil | |
| puts (["cd #{config["dir"]}"] + (config["commands"] || [])) * "\n" | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment