Permalink
Browse files

add config cookbook

  • Loading branch information...
1 parent aa36911 commit 6717bba8bdae0cdb92f03e49439d4926425322e1 @bleything bleything committed Dec 9, 2011
@@ -0,0 +1,8 @@
+= DESCRIPTION:
+
+= REQUIREMENTS:
+
+= ATTRIBUTES:
+
+= USAGE:
+
@@ -0,0 +1,8 @@
+maintainer "bleything.net"
+maintainer_email "ben@bleything.net"
+license "Apache 2.0"
+description "Installs/Configures config"
+long_description IO.read(File.join(File.dirname(__FILE__), 'README.rdoc'))
+version "0.1"
+
+depends 'mac_os_x'
@@ -0,0 +1,18 @@
+#
+# Cookbook Name:: config
+# Recipe:: default
+#
+# Copyright 2011, Ben Bleything <ben@bleything.net>
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
@@ -0,0 +1,42 @@
+#
+# Cookbook Name:: config
+# Recipe:: dock
+#
+# Copyright 2011, Ben Bleything <ben@bleything.net>
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+settings = {
+ "no-glass" => true,
+ "autohide" => true,
+ "showhidden" => true,
+ "show-process-indicators" => false,
+ "checked-for-launchpad" => true,
+ "persistent-apps" => "()"
+}
+
+settings.each do |k,v|
+ mac_os_x_userdefaults k do
+ domain "com.apple.dock"
+ key k
+ value v
+ end
+end
+
+directory "#{ENV['HOME']}/Downloads/About Downloads.lpdf" do
+ action :delete
+ recursive true
+end
+
+execute "killall Dock"
@@ -0,0 +1,39 @@
+#
+# Cookbook Name:: config
+# Recipe:: dock
+#
+# Copyright 2011, Ben Bleything <ben@bleything.net>
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+settings = {
+ "FXPreferredViewStyle" => "Nlsv", # list view
+ "NewWindowTarget" => "PfHm", # home directory
+ "RemoveIDiskFromSidebarOnStartup" => true,
+ "ShowExternalHardDrivesOnDesktop" => true,
+ "ShowHardDrivesOnDesktop" => false,
+ "ShowMountedServersOnDesktop" => true,
+ "ShowRemovableMediaOnDesktop" => true,
+ "ShowStatusBar" => true,
+}
+
+settings.each do |k,v|
+ mac_os_x_userdefaults k do
+ domain "com.apple.finder"
+ key k
+ value v
+ end
+end
+
+execute "killall Finder"
@@ -0,0 +1,40 @@
+#
+# Cookbook Name:: config
+# Recipe:: global
+#
+# Copyright 2011, Ben Bleything <ben@bleything.net>
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+settings = {
+ # fix up keyboard
+ "ApplePressAndHoldEnabled" => false,
+ "NSAutomaticSpellingCorrectionEnabled" => false,
+
+ # expand file and print dialogs
+ "NSNavPanelExpandedStateForSaveMode" => true,
+ "PMPrintingExpandedStateForPrint" => true,
+
+ # look and feel
+ "AppleAquaColorVariant" => 6,
+ "AppleHighlightColor" => "1.000000 0.823500 0.505900"
+}
+
+settings.each do |k,v|
+ mac_os_x_userdefaults k do
+ global true
+ key k
+ value v
+ end
+end
@@ -0,0 +1,30 @@
+#
+# Cookbook Name:: config
+# Recipe:: hostname
+#
+# Copyright 2011, Ben Bleything <ben@bleything.net>
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+execute "scutil --set LocalHostName #{node.hostname}" do
+ not_if Proc.new { `scutil --get LocalHostName`.chomp == node.hostname }
+end
+
+execute "scutil --set HostName #{node.hostname}" do
+ not_if Proc.new { `scutil --get HostName`.chomp == node.hostname }
+end
+
+execute "networksetup -setcomputername #{node.hostname}" do
+ not_if Proc.new { `networksetup -getcomputername`.chomp == node.hostname }
+end
@@ -0,0 +1,37 @@
+#
+# Cookbook Name:: config
+# Recipe:: safari
+#
+# Copyright 2011, Ben Bleything <ben@bleything.net>
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+settings = {
+ "IncludeDevelopMenu" => true,
+ "IncludeInternalDebugMenu" => true,
+ "AutoOpenSafeDownloads" => false,
+ "HomePage" => "https://www.google.com/",
+ "NewTabBehavior" => 1,
+ "NewWindowBehavior" => 0,
+ "TabCreationPolicy" => 1,
+ "ShowStatusBar" => true
+}
+
+settings.each do |k,v|
+ mac_os_x_userdefaults k do
+ domain "com.apple.Safari"
+ key k
+ value v
+ end
+end
@@ -0,0 +1,31 @@
+#
+# Cookbook Name:: config
+# Recipe:: screensaver
+#
+# Copyright 2011, Ben Bleything <ben@bleything.net>
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+settings = {
+ "askForPassword" => 1,
+ "askForPasswordDelay" => 0
+}
+
+settings.each do |k,v|
+ mac_os_x_userdefaults k do
+ domain "com.apple.screensaver"
+ key k
+ value v
+ end
+end
View
@@ -6,6 +6,12 @@
recipe[apps::chrome]
recipe[apps::dropbox]
+ recipe[config::dock]
+ recipe[config::finder]
+ recipe[config::global]
+ recipe[config::hostname]
+ recipe[config::screensaver]
+
recipe[homebrew]
recipe[homebrew::packages]
)

0 comments on commit 6717bba

Please sign in to comment.