Skip to content

Instantly share code, notes, and snippets.

@jtimberman
Created May 25, 2011 17:16
Show Gist options
  • Save jtimberman/991401 to your computer and use it in GitHub Desktop.
Save jtimberman/991401 to your computer and use it in GitHub Desktop.
setting spaces for specific apps on my workstation
{
"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
}
}
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
@jtimberman
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment