Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS settings from the laptop #2

Open
kmayer opened this issue Sep 6, 2019 · 20 comments
Open

macOS settings from the laptop #2

kmayer opened this issue Sep 6, 2019 · 20 comments
Labels
enhancement New feature or request

Comments

@kmayer
Copy link
Contributor

kmayer commented Sep 6, 2019

per @christiannelson

@ken this is that resource for setting macOS setting from the command line. i only use a small set of these in my personal laptop bootstraper, but it's a good resource for those who want to automate more laptop config.

https://github.com/mathiasbynens/dotfiles/blob/master/.macos

@kmayer kmayer added the enhancement New feature or request label Sep 6, 2019
@kmayer
Copy link
Contributor Author

kmayer commented Sep 6, 2019

There is so much cruft in this file. Cherry pick only the best stuffs.

@kmayer
Copy link
Contributor Author

kmayer commented Sep 6, 2019

# Trackpad: enable tap to click for this user and for the login screen
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true
defaults -currentHost write NSGlobalDomain com.apple.mouse.tapBehavior -int 1
defaults write NSGlobalDomain com.apple.mouse.tapBehavior -int 1

@kmayer
Copy link
Contributor Author

kmayer commented Sep 6, 2019

# Increase sound quality for Bluetooth headphones/headsets
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" -int 40

@kmayer
Copy link
Contributor Author

kmayer commented Sep 6, 2019

# Enable full keyboard access for all controls
# (e.g. enable Tab in modal dialogs)
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3

@kmayer
Copy link
Contributor Author

kmayer commented Sep 6, 2019

# Require password immediately after sleep or screen saver begins
defaults write com.apple.screensaver askForPassword -int 1
defaults write com.apple.screensaver askForPasswordDelay -int 0

@kmayer
Copy link
Contributor Author

kmayer commented Sep 6, 2019

... I stopped looking at about line 300 ... https://github.com/mathiasbynens/dotfiles/blob/master/.macos#L300

@kmayer
Copy link
Contributor Author

kmayer commented Oct 27, 2019

# Show the ~/Library folder
chflags nohidden ~/Library

@kmayer
Copy link
Contributor Author

kmayer commented Oct 27, 2019

# Show the /Volumes folder
sudo chflags nohidden /Volumes

@kmayer
Copy link
Contributor Author

kmayer commented Oct 27, 2019

# Add iOS & Watch Simulator to Launchpad
sudo ln -sf "/Applications/Xcode.app/Contents/Developer/Applications/Simulator.app" "/Applications/Simulator.app"
sudo ln -sf "/Applications/Xcode.app/Contents/Developer/Applications/Simulator (Watch).app" "/Applications/Simulator (Watch).app"

@kmayer
Copy link
Contributor Author

kmayer commented Oct 27, 2019

# Privacy: don’t send search queries to Apple
defaults write com.apple.Safari UniversalSearchEnabled -bool false
defaults write com.apple.Safari SuppressSearchSuggestions -bool true

@kmayer
Copy link
Contributor Author

kmayer commented Oct 27, 2019


# Disable AutoFill
defaults write com.apple.Safari AutoFillFromAddressBook -bool false
defaults write com.apple.Safari AutoFillPasswords -bool false
defaults write com.apple.Safari AutoFillCreditCardData -bool false
defaults write com.apple.Safari AutoFillMiscellaneousForms -bool false

@kmayer
Copy link
Contributor Author

kmayer commented Oct 27, 2019

# Warn about fraudulent websites
defaults write com.apple.Safari WarnAboutFraudulentWebsites -bool true

@kmayer
Copy link
Contributor Author

kmayer commented Oct 27, 2019

# Enable “Do Not Track”
defaults write com.apple.Safari SendDoNotTrackHTTPHeader -bool true

@kmayer
Copy link
Contributor Author

kmayer commented Oct 27, 2019

# Use a modified version of the Solarized Dark theme by default in Terminal.app
osascript <<EOD
tell application "Terminal"
	local allOpenedWindows
	local initialOpenedWindows
	local windowID
	set themeName to "Solarized Dark xterm-256color"
	(* Store the IDs of all the open terminal windows. *)
	set initialOpenedWindows to id of every window
	(* Open the custom theme so that it gets added to the list
	   of available terminal themes (note: this will open two
	   additional terminal windows). *)
	do shell script "open '$HOME/init/" & themeName & ".terminal'"
	(* Wait a little bit to ensure that the custom theme is added. *)
	delay 1
	(* Set the custom theme as the default terminal theme. *)
	set default settings to settings set themeName
	(* Get the IDs of all the currently opened terminal windows. *)
	set allOpenedWindows to id of every window
	repeat with windowID in allOpenedWindows
		(* Close the additional windows that were opened in order
		   to add the custom theme to the list of terminal themes. *)
		if initialOpenedWindows does not contain windowID then
			close (every window whose id is windowID)
		(* Change the theme for the initial opened terminal windows
		   to remove the need to close them in order for the custom
		   theme to be applied. *)
		else
			set current settings of tabs of (every window whose id is windowID) to settings set themeName
		end if
	end repeat
end tell
EOD

@kmayer
Copy link
Contributor Author

kmayer commented Oct 27, 2019

# Enable Secure Keyboard Entry in Terminal.app
# See: https://security.stackexchange.com/a/47786/8918
defaults write com.apple.terminal SecureKeyboardEntry -bool true

@kmayer
Copy link
Contributor Author

kmayer commented Oct 27, 2019

# Install the Solarized Dark theme for iTerm
open "${HOME}/init/Solarized Dark.itermcolors"

@kmayer
Copy link
Contributor Author

kmayer commented Oct 27, 2019

# Don’t display the annoying prompt when quitting iTerm
defaults write com.googlecode.iterm2 PromptOnQuit -bool false

@kmayer
Copy link
Contributor Author

kmayer commented Oct 27, 2019

# Prevent Time Machine from prompting to use new hard drives as backup volume
defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool true
``

@kmayer
Copy link
Contributor Author

kmayer commented Oct 27, 2019

# Prevent Photos from opening automatically when devices are plugged in
defaults -currentHost write com.apple.ImageCapture disableHotPlug -bool true

@kmayer
Copy link
Contributor Author

kmayer commented Oct 27, 2019

Controversial

###############################################################################
# Google Chrome & Google Chrome Canary                                        #
###############################################################################

# Disable the all too sensitive backswipe on trackpads
defaults write com.google.Chrome AppleEnableSwipeNavigateWithScrolls -bool false
defaults write com.google.Chrome.canary AppleEnableSwipeNavigateWithScrolls -bool false

# Disable the all too sensitive backswipe on Magic Mouse
defaults write com.google.Chrome AppleEnableMouseSwipeNavigateWithScrolls -bool false
defaults write com.google.Chrome.canary AppleEnableMouseSwipeNavigateWithScrolls -bool false

# Use the system-native print preview dialog
defaults write com.google.Chrome DisablePrintPreview -bool true
defaults write com.google.Chrome.canary DisablePrintPreview -bool true

# Expand the print dialog by default
defaults write com.google.Chrome PMPrintingExpandedStateForPrint2 -bool true
defaults write com.google.Chrome.canary PMPrintingExpandedStateForPrint2 -bool true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant