Skip to content

Commit

Permalink
v0.2.0: Spawn a new OS X space before running the iTermocil script.
Browse files Browse the repository at this point in the history
  • Loading branch information
julienma committed Apr 22, 2016
1 parent 6379a12 commit 39e369c
Showing 1 changed file with 28 additions and 4 deletions.
32 changes: 28 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
This launcher allows you to run those scripts *without even being* in your terminal. The whole point for iTermocil being to open that terminal for me.

That's an Automator app, which just take a `*.itermocil` file as an argument and run it.
That's an Automator app, which just take a `*.itermocil` file as an argument, create a new OS X Space, and open the terminal commands thanks to iTermocil.

## Install

Expand Down Expand Up @@ -37,18 +37,42 @@ That's an Automator app, which just take a `*.itermocil` file as an argument and
- gulp
```

3. [Download iTermocil.app](https://github.com/julienma/itermocil-launcher/releases/download/v0.1.0/iTermocil-v0.1.0.zip) (the Automator app), and copy it to your `/Applications` folder.
3. [Download iTermocil.app (terminal-only)](https://github.com/julienma/itermocil-launcher/releases/download/v0.2.0/iTermocil-v0.2.0.zip) or [iTermocil-NewSpace.app (spawn a new OS X Space)](https://github.com/julienma/itermocil-launcher/releases/download/v0.2.0/iTermocil-NewSpace-v0.2.0.zip), and copy it to your `/Applications` folder.

4. Associate iTermocil.app with `*.itermocil` files: right-click on your new `whatever.itermocil` file > Get Info > Open with > select `iTermocil.app` > click "Change All".

## Usage

Just double-click on any of your `*.itermocil` file, and the script will be run.

If you're using the iTermocil-NewSpace.app, it will also spawn a brand new OS X Space, so all the apps (IDE, Browser, Finder, etc.) related to your project, which will be opened by your iTermocil script, will be grouped together.
## Create your own Automator app
Open Automator, create a new Application.
Add a "Run a shell script" step with these parameters:
Add an Applescript step:
```
on run {input, parameters}
tell application "System Events"
--mission control starten
do shell script "/Applications/Mission\\ Control.app/Contents/MacOS/Mission\\ Control"
tell process "Dock"
set countSpaces to count buttons of list 1 of group 1
--new space
click button 1 of group 1
--switch to new space
repeat until (count buttons of list 1 of group 1) = (countSpaces + 1)
end repeat
click button (countSpaces + 1) of list 1 of group 1
end tell
end tell
return input
end run
```
Then add a Shell script step with these parameters:
- shell: `/bin/bash`
- input: arguments
- code:
Expand All @@ -58,7 +82,7 @@ export PATH=/usr/local/bin:$PATH
itermocil --layout $1
```
Then save as an .app, copy a nice custom icon (like [this one](https://dribbble.com/shots/1343859-iTerm2-Icon)), and profit.
Finally, save as an .app, copy a nice custom icon (like [this one](https://dribbble.com/shots/1343859-iTerm2-Icon)), and profit.
---
Expand Down

0 comments on commit 39e369c

Please sign in to comment.