Skip to content

Instantly share code, notes, and snippets.

@rettuce
Created January 20, 2016 16:05
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save rettuce/71c801881e1433c3a9de to your computer and use it in GitHub Desktop.
Save rettuce/71c801881e1433c3a9de to your computer and use it in GitHub Desktop.
osx setup command. use com.apple.dock.plist
#!/bin/sh
### Desktop & Screen Saver
# Desktopを黒に
echo "Change Desctop Pictures"
osascript -e 'tell application "Finder" to set desktop picture to POSIX file "/Library/Desktop Pictures/Solid Colors/Solid Gray Pro Ultra Dark.png"'
# ScreenSaver Kill
echo "Disable screensaver"
defaults write com.apple.screensaver idleTime -int 0
defaults -currentHost write com.apple.screensaver idleTime -int 0
### Dock
echo "Set Dock to left hand side"
defaults write com.apple.dock orientation -string 'left'
# Dockの中身を SystemPreferences, Terminal, ActivityMonitor のみにする
echo "Copy ~/Library/Preferences/com.apple.dock.plist"
cd `dirname $0`
sudo cp com.apple.dock.plist ~/Library/Preferences/com.apple.dock.plist
### Mission Control
# Display作業スペース分割OFF
echo "Displays have separate Spaces"
defaults write com.apple.spaces spans-displays -bool FALSE
### Notifications
echo "Disable Notification center."
launchctl unload /System/Library/LaunchAgents/com.apple.notificationcenterui.plist
### Energy Saver
echo "Disable system sleep"
sudo pmset sleep 0
echo "Disable display sleep"
sudo pmset displaysleep 0
echo "Enable wake on ethernet"
sudo pmset womp 1
### Mouse
# Scroll direction : natural を OFF
echo "Scroll direction : natural"
defaults write -g com.apple.swipescrolldirection -bool FALSE
# 右クリックON
echo "Secondary click"
defaults write com.apple.driver.AppleBluetoothMultitouch.mouse MouseButtonMode -string 'TwoButton'
defaults write com.apple.driver.AppleHIDMouse Button2 -int 2
### User & Groups
# 自動ログイン
echo "Setup auto login."
sudo defaults write /Library/Preferences/com.apple.loginwindow autoLoginUser $(whoami)
### App Store
# 自動更新OFF
echo "Disable : SystemPreferences -> AppStore -> Automatically check for updates"
sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticCheckEnabled -bool FALSE
### utility
# Libraryフォルダ表示
echo "Show the ~/Library folder"
chflags nohidden ~/Library
# Dashboard無効化
echo "Disable dashboard"
defaults write com.apple.dashboard mcx-disabled -boolean YES
# network上に.DS_Store作らない
echo "Avoid creating .DS_Store files on network volumes"
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool TRUE
# 拡張子変更時のwarningを出さない
echo "Disable the warning when changing a file extension"
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool FALSE
# 未承認のアプリも右クリックなく開ける
echo "Disable Warning on opening new App."
spctl --master-disable
# 起動時のクラッシュワーニングを出さない
echo "Disable crash working on application start."
defaults write NSGlobalDomain NSQuitAlwaysKeepsWindows -bool FALSE
# ウィンドウ復元無効化
echo "Disable resume on start"
defaults write -g ApplePersistenceIgnoreState YES
# クラッシュレポーター出さない
echo "Disable crash reporter"
defaults write com.apple.CrashReporter DialogType none
defaults write com.apple.CrashReporter UseUNC 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment