Created
          May 25, 2011 17:16 
        
      - 
      
- 
        Save jtimberman/991401 to your computer and use it in GitHub Desktop. 
    setting spaces for specific apps on my workstation
  
        
  
    
      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
    
  
  
    
  | { | |
| "id": "workstation" | |
| "space_bindings": { | |
| "com.adiumx.adiumx": 4, | |
| "com.apple.itunes": 3, | |
| "com.googlecode.iterm2": 2, | |
| "com.skype.skype": 4, | |
| "com.sparrowmailapp.sparrow": 4, | |
| "macirssi": 4, | |
| "org.gnu.emacs": 2, | |
| "ws.agile.1password": 65544 | |
| } | |
| } | 
  
    
      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
    
  
  
    
  | wk = data_bag_item("apps", "workstation") | |
| wk['space_bindings'].each do |app, space| | |
| execute "Assign #{app} to space #{space}" do | |
| command "defaults write com.apple.dock workspaces-app-bindings -dict-add #{app} #{space}" | |
| not_if "defaults read com.apple.dock workspaces-app-bindings 2>&1 | grep -xq '.*#{app}.*#{space};'" | |
| notifies :run, "execute[killall Dock]" | |
| end | |
| end | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
            
@imeyer No. https://twitter.com/#!/jtimberman/status/73450718429847552