diff --git a/os/darwin.fish b/os/darwin.fish index b2b2ab0..ae25056 100755 --- a/os/darwin.fish +++ b/os/darwin.fish @@ -5,3 +5,6 @@ find "$DOT/os/macos/" -name "*.pref.fish" | while read file fish -c "$file" end + +killall SystemUIServer &>/dev/null +killall cfprefsd &>/dev/null diff --git a/os/macos/activity_monitor.pref.fish b/os/macos/activity_monitor.pref.fish new file mode 100755 index 0000000..5c5ded2 --- /dev/null +++ b/os/macos/activity_monitor.pref.fish @@ -0,0 +1,22 @@ +#!/usr/bin/env fish + +source "$DOT/script/utils.fish" + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +print_subtitle "Activity Monitor" + +execute "defaults write com.apple.ActivityMonitor OpenMainWindow -bool true" \ + "Show the main window on launch" + +execute "defaults write com.apple.ActivityMonitor IconType -int 5" \ + "Show CPU usage as the dock icon" + +execute "defaults write com.apple.ActivityMonitor ShowCategory -int 0" \ + "Show all processes" + +execute "defaults write com.apple.ActivityMonitor SortColumn -string 'CPUUsage' && \ + defaults write com.apple.ActivityMonitor SortDirection -int 0" \ + "Sort results by CPU usage" + +killall "Activity Monitor" &>/dev/null diff --git a/os/macos/app_store.pref.fish b/os/macos/app_store.pref.fish index d663076..bca9d0d 100755 --- a/os/macos/app_store.pref.fish +++ b/os/macos/app_store.pref.fish @@ -18,4 +18,7 @@ execute "defaults write come.apple.SoftwareUpdate AutomaticDownload -int 1" \ execute "defaults write com.apple.SoftwareUpdate CriticalUpdateInstall -int 1" \ "Install system data files and security updates" +execute "defaults write com.apple.SoftwareUpdate ConfigDataInstall -int 1" \ + "Automatically download apps purchased on other Macs" + killall "App Store" &>/dev/null diff --git a/os/macos/battery.pref.fish b/os/macos/battery.pref.fish new file mode 100755 index 0000000..dc71acf --- /dev/null +++ b/os/macos/battery.pref.fish @@ -0,0 +1,20 @@ +#!/usr/bin/env fish + +source "$DOT/script/utils.fish" + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +execute "sudo pmset -a lidwake 1" \ + "Enable lid wakeup" + +execute "sudo systemsetup -setrestartfreeze on" \ + "Restart automatically if the computer freezes" + +execute "sudo pmset -a displaysleep 15" \ + "Display sleep after 15 minutes" + +execute "sudo pmset -c sleep 30" \ + "Machine sleep after 30 minutes while charging" + +execute "sudo pmset -b sleep 10" \ + "Machine sleep after 10 minutes on battery" diff --git a/os/macos/dock.pref.fish b/os/macos/dock.pref.fish index c0503ee..b9894bf 100755 --- a/os/macos/dock.pref.fish +++ b/os/macos/dock.pref.fish @@ -6,6 +6,15 @@ source "$DOT/script/utils.fish" print_subtitle Dock +execute "defaults write com.apple.dock tilesize -int 50" \ + "Set icon size" + +execute "defaults write com.apple.dock magnification -bool true" \ + "Enable magnification" + +execute "defaults write com.apple.dock largesize -int 75" \ + "Set magnification icon size" + execute "defaults write com.apple.dock autohide -bool true" \ "Automatically hide/show the dock" @@ -27,4 +36,34 @@ execute "defaults write com.apple.dock mru-spaces -bool false" \ execute "defaults write com.apple.dock show-recents -bool false" \ "Do not show recent applications in dock" +execute "defaults write com.apple.dock show-process-indicators -bool true" \ + "Show indicator lights for open applications" + +execute "defaults write com.apple.dashboard mcx-disabled -bool false" \ + "Disable dashboard" + +execute "defaults write com.apple.dock dashboard-in-overlay -bool true" \ + "Don't show dashboard as a space" + +execute "defaults write com.apple.dock showhidden -bool true" \ + "Show hidden applications in dock" + +print_subtitle "Hot Corners" + +execute "defaults write com.apple.dock wvous-tl-corner -int 4 && \ + defaults write com.apple.dock wvous-tl-modifier -int 0" \ + "Set top left corner -> show desktop" + +execute "defaults write com.apple.dock wvous-bl-corner -int 11 && \ + defaults write com.apple.dock wvous-bl-modifier -int 0" \ + "Set bottom left corner -> show launchpad" + +execute "defaults write com.apple.dock wvous-tr-corner -int 0 && \ + defaults write com.apple.dock wvous-tr-modifier -int 0" \ + "Set top right corner -> do nothing" + +execute "defaults write com.apple.dock wvous-br-corner -int 0 && \ + defaults write com.apple.dock wvous-br-modifier -int 0" \ + "Set bottom right corner -> do nothing" + killall Dock &>/dev/null diff --git a/os/macos/finder.pref.fish b/os/macos/finder.pref.fish index dfd79e2..3aa4920 100755 --- a/os/macos/finder.pref.fish +++ b/os/macos/finder.pref.fish @@ -6,6 +6,10 @@ source "$DOT/script/utils.fish" print_subtitle Finder +execute "defaults write com.apple.finder NewWindowTarget -string 'PfHm' && \ + defaults write com.apple.finder NewWindowTargetPath -string 'file:///Users/marley/'" \ + "Set ~ as the default location for new Finder windows" + execute "defaults write com.apple.finder _FXShowPosixPathInTitle -bool true" \ "Use full POSIX path as window title" @@ -39,10 +43,24 @@ execute "defaults write com.apple.finder FXRemoveOldTrashItems -bool true" \ execute "defaults write com.apple.universalaccess showWindowTitlebarIcons -bool true" \ "Show folder icons in the title bar" +execute "defaults write com.apple.finder FXPreferredViewStyle -string 'icnv'" \ + "Use icon view by default" execute "/usr/libexec/PlistBuddy -c 'Set :DesktopViewSettings:IconViewSettings:arrangeBy name' ~/Library/Preferences/com.apple.finder.plist && \ + /usr/libexec/PlistBuddy -c 'Set :FK_StandardViewSettings:IconViewSettings:arrangeBy name' ~/Library/Preferences/com.apple.finder.plist && \ /usr/libexec/PlistBuddy -c 'Set :StandardViewSettings:IconViewSettings:arrangeBy name' ~/Library/Preferences/com.apple.finder.plist" \ "Set sort method" +execute "defaults write -g com.apple.springing.enabled -bool true" \ + "Enable spring loading for directories" + +execute "defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true && \ + defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true" \ + "Don't create .DS_Store files on network or USB volumes" + +execute "defaults write com.apple.frameworks.diskimages auto-open-ro-root -bool false && \ + defaults write com.apple.frameworks.diskimages auto-open-rw-root -bool false && \ + defaults write com.apple.finder OpenWindowForNewRemoveableDisk -bool true" \ + "Don't automatically open a Finder window when a volume is mounted" + killall Finder &>/dev/null -killall cfprefsd &>/dev/null diff --git a/os/macos/trackpad.pref.fish b/os/macos/input_devices.pref.fish similarity index 66% rename from os/macos/trackpad.pref.fish rename to os/macos/input_devices.pref.fish index f58cf8d..2802a10 100755 --- a/os/macos/trackpad.pref.fish +++ b/os/macos/input_devices.pref.fish @@ -4,7 +4,7 @@ source "$DOT/script/utils.fish" # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -print_subtitle Trackpad +print_subtitle "Input Devices" execute "defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true && \ @@ -20,3 +20,16 @@ execute "defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Track defaults write com.apple.AppleMultitouchTrackpad TrackpadCornerSecondaryClick -int 0 && \ defaults -currentHost write -g com.apple.trackpad.trackpadCornerClickBehavior -int 0" \ "Map 'click or tap with two fingers' to the secondary click" + +execute "defaults write -g AppleKeyboardUIMode -int 3" \ + "Allow tab-to-navigate in all windows" + +execute "defaults write com.apple.HIToolbox AppleFnUsageType -int 2" \ + "Remap the emoji picker to the Fn key" + +execute "defaults write com.apple.universalaccess closeViewScrollWheelToggle -bool true && \ + defaults write com.apple.universalaccess HIDScrollZoomModifierMask -int 262144" \ + "Use to zoom" + +execute "defaults write com.apple.universalaccess closeViewZoomFollowsFocus -bool true" \ + "Follow the keyboard focus while zoomed in" diff --git a/os/macos/keyboard.pref.fish b/os/macos/keyboard.pref.fish deleted file mode 100755 index 4197326..0000000 --- a/os/macos/keyboard.pref.fish +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env fish - -source "$DOT/script/utils.fish" - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -print_subtitle Keyboard - -execute "defaults write -g AppleKeyboardUIMode -int 3" \ - "Enable full keyboard access for all controls" - -execute "defaults write NSGlobalDomain NSAutomaticCapitalizationEnabled -bool false" \ - "Disable automatic capitalization" - -execute "defaults write -g NSAutomaticSpellingCorrectionEnabled -bool false" \ - "Disable automatic correction" - -execute "defaults write com.apple.HIToolbox AppleFnUsageType -int 2" \ - "Remap the emoji picker to the Fn key" diff --git a/os/macos/language_and_region.pref.fish b/os/macos/language_and_region.pref.fish index 1bf2d48..cca64cc 100755 --- a/os/macos/language_and_region.pref.fish +++ b/os/macos/language_and_region.pref.fish @@ -9,5 +9,14 @@ print_subtitle "Language & Region" execute "defaults write -g AppleLanguages -array 'en'" \ "Set language" +execute "defaults write -g AppleLocale -string 'en_US@currency=USD'" \ + "Set currency" + +execute "defaults write -g AppleMeasurementUnits -string 'Inches'" \ + "Set measurement unit" + +execute "defaults write -g AppleMetricUnits -bool false" \ + "Use imperial measurement system" + execute "defaults write -g AppleICUDateFormatStrings -dict 2 'd MMM y' 3 'd MMMM y' 4 'EEEE, d MMMM y'" \ "Set date formats" diff --git a/os/macos/photos.pref.fish b/os/macos/photos.pref.fish index f63bc07..2dfbd50 100755 --- a/os/macos/photos.pref.fish +++ b/os/macos/photos.pref.fish @@ -9,5 +9,4 @@ print_subtitle Photos execute "defaults -currentHost write com.apple.ImageCapture disableHotPlug -bool true" \ "Prevent Photos from opening automatically when devices are plugged in" - killall Photos &>/dev/null diff --git a/os/macos/safari.pref.fish b/os/macos/safari.pref.fish index cc6df92..b2cf7bf 100755 --- a/os/macos/safari.pref.fish +++ b/os/macos/safari.pref.fish @@ -10,4 +10,7 @@ execute "defaults write com.apple.Safari SuppressSearchSuggestions -bool true && defaults write com.apple.Safari UniversalSearchEnabled -bool false" \ "Don’t send search queries to Apple" +execute "defaults write com.apple.Safari SendDoNotTrackHTTPHeader -bool true" \ + "Enable 'Do Not Track'" + killall Safari &>/dev/null diff --git a/os/macos/security_and_privacy.pref.fish b/os/macos/security_and_privacy.pref.fish index c960e7f..0eed3d8 100755 --- a/os/macos/security_and_privacy.pref.fish +++ b/os/macos/security_and_privacy.pref.fish @@ -8,3 +8,7 @@ print_subtitle "Security & Privacy" execute "defaults write com.apple.AdLib allowApplePersonalizedAdvertising -int 0" \ "Disable personalized ads" + +execute "defaults write com.apple.screensaver askForPassword -int 1 && \ + defaults write com.apple.screensaver askForPasswordDelay -int 0" \ + "Require password immediately after sleep or screensaver begins" diff --git a/os/macos/spotlight.pref.fish b/os/macos/spotlight.pref.fish new file mode 100755 index 0000000..a46363c --- /dev/null +++ b/os/macos/spotlight.pref.fish @@ -0,0 +1,40 @@ +#!/usr/bin/env fish + +source "$DOT/script/utils.fish" + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +print_subtitle Spotlight + +execute "defaults write com.apple.spotlight orderedItems -array \ + '{\"enabled\" = 1;\"name\" = \"APPLICATIONS\";}' \ + '{\"enabled\" = 1;\"name\" = \"SYSTEM_PREFS\";}' \ + '{\"enabled\" = 1;\"name\" = \"DIRECTORIES\";}' \ + '{\"enabled\" = 1;\"name\" = \"PDF\";}' \ + '{\"enabled\" = 1;\"name\" = \"FONTS\";}' \ + '{\"enabled\" = 1;\"name\" = \"DOCUMENTS\";}' \ + '{\"enabled\" = 1;\"name\" = \"MESSAGES\";}' \ + '{\"enabled\" = 1;\"name\" = \"CONTACT\";}' \ + '{\"enabled\" = 0;\"name\" = \"EVENT_TODO\";}' \ + '{\"enabled\" = 0;\"name\" = \"IMAGES\";}' \ + '{\"enabled\" = 0;\"name\" = \"BOOKMARKS\";}' \ + '{\"enabled\" = 0;\"name\" = \"MUSIC\";}' \ + '{\"enabled\" = 0;\"name\" = \"MOVIES\";}' \ + '{\"enabled\" = 0;\"name\" = \"PRESENTATIONS\";}' \ + '{\"enabled\" = 0;\"name\" = \"SPREADSHEETS\";}' \ + '{\"enabled\" = 0;\"name\" = \"SOURCE\";}' \ + '{\"enabled\" = 1;\"name\" = \"MENU_DEFINITION\";}' \ + '{\"enabled\" = 0;\"name\" = \"MENU_OTHER\";}' \ + '{\"enabled\" = 1;\"name\" = \"MENU_CONVERSION\";}' \ + '{\"enabled\" = 1;\"name\" = \"MENU_EXPRESSION\";}' \ + '{\"enabled\" = 0;\"name\" = \"MENU_WEBSEARCH\";}' \ + '{\"enabled\" = 0;\"name\" = \"MENU_SPOTLIGHT_SUGGESTIONS\";}'" \ + "Customize Spotlight search categories" + +killall mds &>/dev/null + +# Make sure indexing is enabled for the main volume. +sudo mdutil -i on / >/dev/null + +# Rebuild index from scratch. +sudo mdutil -E / >/dev/null diff --git a/os/macos/terminal.pref.fish b/os/macos/terminal.pref.fish index ba43064..ff8086f 100755 --- a/os/macos/terminal.pref.fish +++ b/os/macos/terminal.pref.fish @@ -7,6 +7,11 @@ source "$DOT/script/utils.fish" print_subtitle Terminal if ! grep -q "pam_tid.so" "/etc/pam.d/sudo" - execute "sudo sh -c 'echo \"auth sufficient pam_tid.so\" >> /etc/pam.d/sudo'" \ - "Use Touch ID to authenticate sudo" + execute "sudo sh -c 'echo \"auth sufficient pam_tid.so\" >> /etc/pam.d/sudo'" + "Use Touch ID to authenticate sudo" end + +execute "defaults write com.apple.terminal StringEncodings -array 4" \ + "Only use UTF-8 encoding" + +killall Terminal &>/dev/null diff --git a/os/macos/timemachine.pref.fish b/os/macos/timemachine.pref.fish new file mode 100755 index 0000000..91d3f21 --- /dev/null +++ b/os/macos/timemachine.pref.fish @@ -0,0 +1,8 @@ +#!/usr/bin/env fish + +source "$DOT/script/utils.fish" + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +execute "defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool true" \ + "Do not ask to use new hard drives as a backup volume" diff --git a/os/macos/ui_and_ux.pref.fish b/os/macos/ui_and_ux.pref.fish index 58838f7..ba5c5e7 100755 --- a/os/macos/ui_and_ux.pref.fish +++ b/os/macos/ui_and_ux.pref.fish @@ -6,6 +6,12 @@ source "$DOT/script/utils.fish" print_subtitle "UI & UX" +execute "defaults write -g AppleAccentColor -int 6" \ + "Set accent color to pink" + +execute "defaults write -g AppleHighlightColor -string '1.000000 0.749020 0.823529 Pink'" \ + "Set highlight color to pink" + execute "defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true && \ defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true" \ "Avoid creating '.DS_Store' files on network or USB volumes" @@ -28,7 +34,19 @@ execute "defaults write com.apple.screencapture type -string 'png'" \ execute "defaults write -g AppleFontSmoothing -int 2" \ "Enable subpixel font rendering on non-Apple LCDs" -execute "defaults write -g NSNavPanelExpandedStateForSaveMode -bool true" \ +execute "defaults write -g NSNavPanelExpandedStateForSaveMode -bool true; \ + defaults write -g NSNavPanelExpandedStateForSaveMode2 -bool true" \ "Expand save panel by default" -killall SystemUIServer &>/dev/null +execute "defaults write -g PMPrintingExpandedStateForPrint -bool true && \ + defaults write -g PMPrintingExpandedStateForPrint2 -bool true" \ + "Expand print panel by default" + +execute "defaults write com.apple.print.PrintingPrefs 'Quit When Finished' -bool true" \ + "Automatically quite printer app once print jobs complete" + +execute "defaults write -g NSAutomaticCapitalizationEnabled -bool false" \ + "Disable automatic capitalization" + +execute "defaults write -g NSAutomaticSpellingCorrectionEnabled -bool false" \ + "Disable automatic spelling correction"