Last active
February 26, 2024 04:34
-
-
Save hedlund/42ded191f15f6c80a95456d70022d2f9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Install by running: | |
# /usr/bin/env bash <(curl -fsSL https://gist.githubusercontent.com/hedlund/42ded191f15f6c80a95456d70022d2f9/raw) | |
if [[ "$(uname -s)" != "Darwin" ]]; then | |
echo "Not running on Mac OS X. Aborting!" | |
exit 1 | |
fi | |
############################################################################### | |
# Installation # | |
############################################################################### | |
# Install Homebrew unless it's already installed | |
if [ -z "$(which brew)" ]; then | |
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" </dev/null | |
fi | |
# Make sure we’re using the latest Homebrew & upgrade all installed formulae. | |
brew update && brew upgrade | |
# Tap a few extra repositories | |
brew tap caskroom/cask | |
brew tap caskroom/fonts | |
brew tap caskroom/versions | |
# Update the core utilities (those that come with OS X are outdated) | |
brew install bash | |
brew install bash-completion2 | |
brew install coreutils | |
brew install findutils | |
brew install git git-lfs && git lfs install | |
brew install gnu-sed --with-default-names | |
brew install grep --with-default-names | |
brew install moreutils | |
brew install nano | |
brew install openssh | |
brew install screen | |
brew install wget --with-iri | |
# Install other useful binaries. | |
brew install ack | |
brew install blackbox | |
brew install dep | |
brew install direnv | |
brew install envchain | |
brew install fzf | |
brew install go | |
brew install gpg pinentry-mac | |
brew install httpie | |
brew install hub | |
brew install node | |
brew install pstree | |
brew install rsync | |
brew install scons | |
brew install telnet | |
brew install tig | |
brew install tree | |
brew install yarn | |
brew install z | |
# Install UI apps | |
brew cask install 1password | |
brew cask install alfred | |
brew cask install ao | |
brew cask install appzapper | |
brew cask install arduino | |
brew cask install boostnote | |
brew cask install caffeine | |
brew cask install daisydisk | |
brew cask install dash | |
brew cask install docker | |
brew cask install dropbox | |
brew cask install etcher | |
brew cask install firefox-developer-edition | |
brew cask install google-chrome | |
brew cask install google-cloud-sdk | |
brew cask install hyper | |
brew cask install istat-menus | |
#brew cask install iterm2 | |
brew cask install java | |
brew cask install little-snitch | |
brew cask install mailspring | |
brew cask install micro-snitch | |
brew cask install now | |
brew cask install owasp-zap | |
brew cask install postman | |
brew cask install raindropio | |
brew cask install slack | |
brew cask install spectacle | |
brew cask install spotify | |
#brew cask install virtualbox | |
brew cask install visual-studio-code | |
# Install some fonts | |
brew cask install font-fira-code | |
brew cask install font-inconsolata | |
# Remove outdated versions from the cellar | |
brew cleanup && brew cask cleanup | |
############################################################################### | |
# Configure terminal # | |
############################################################################### | |
# Explicitly replace some built-ins | |
sudo ln -s /usr/local/bin/gsha256sum /usr/local/bin/sha256sum | |
sudo ln -s /usr/local/bin/gmktemp /usr/local/bin/mktemp | |
# Link pinentry to common name | |
sudo ln -s /usr/local/bin/pinentry-mac /usr/local/bin/pinentry-yubikey | |
# Add the new bash version to /etc/shells (if needed) | |
if [ -f /usr/local/bin/bash ]; then | |
if ! grep -q "/usr/local/bin/bash" /etc/shells; then | |
sudo bash -c 'echo "/usr/local/bin/bash" >> /etc/shells' | |
chsh -s /usr/local/bin/bash | |
fi | |
fi | |
# Create the Projects folders | |
export GOPATH="$HOME/Projects/golang" | |
[ ! -d "$GOPATH/src" ] && mkdir -p "$GOPATH/src" | |
[ ! -d "$HOME/Projects/arduino" ] && mkdir -p "$HOME/Projects/arduino" | |
############################################################################### | |
# Start a few applications to get the config started # | |
############################################################################### | |
open -a "1Password 7" | |
open -a Arduino | |
open -a Dash | |
open -a Docker | |
open -a Dropbox | |
open -a "iStat Menus" | |
open -a "Micro Snitch" | |
# On macOS Sierra accessibility mode cannot be enabled automatically | |
open /System/Library/PreferencePanes/Security.prefPane/ | |
# Open up the Little Snitch installer | |
LITTLESNITCH_PATH="/usr/local/Caskroom/little-snitch" | |
if [[ "$(brew cask info little-snitch)" =~ $LITTLESNITCH_PATH/([0-9]+\.[0-9]+\.?[0-9]*) ]]; then | |
VERSION="${BASH_REMATCH[1]}" | |
open "$LITTLESNITCH_PATH/$VERSION/LittleSnitch-$VERSION.dmg" | |
fi | |
#TODO: do we need to put a delay or a prompt here? | |
############################################################################### | |
# General UI/UX # | |
############################################################################### | |
# Disable the sound effects on boot | |
sudo nvram SystemAudioVolume=" " | |
# Menu bar: hide the Time Machine, Volume, User and Battery icons | |
for domain in ~/Library/Preferences/ByHost/com.apple.systemuiserver.*; do | |
defaults write "${domain}" dontAutoLoad -array \ | |
"/System/Library/CoreServices/Menu Extras/TimeMachine.menu" \ | |
"/System/Library/CoreServices/Menu Extras/User.menu" \ | |
"/System/Library/CoreServices/Menu Extras/Battery.menu" | |
done | |
defaults write com.apple.systemuiserver menuExtras -array \ | |
"/System/Library/CoreServices/Menu Extras/Clock.menu" \ | |
"/System/Library/CoreServices/Menu Extras/Bluetooth.menu" \ | |
"/System/Library/CoreServices/Menu Extras/AirPort.menu" \ | |
"/System/Library/CoreServices/Menu Extras/Volume.menu" \ | |
"/System/Library/CoreServices/Menu Extras/TextInput.menu" | |
defaults delete "com.apple.systemuiserver" "NSStatusItem Visible com.apple.menuextra.battery" | |
#TODO: This still doesn't remove the default battery icon from the top menu... :( | |
# Enable dark mode | |
defaults write "Apple Global Domain" AppleInterfaceStyle -string "Dark" | |
# Expand save panel by default | |
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true | |
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true | |
# Expand print panel by default | |
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true | |
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint2 -bool true | |
# Save to disk (not to iCloud) by default | |
defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false | |
# Display ASCII control characters using caret notation in standard text views | |
# Try e.g. `cd /tmp; unidecode "\x{0000}" > cc.txt; open -e cc.txt` | |
defaults write NSGlobalDomain NSTextShowsControlCharacters -bool true | |
# Disable Resume system-wide | |
defaults write com.apple.systempreferences NSQuitAlwaysKeepsWindows -bool false | |
# Display contact info on login window | |
sudo defaults write /Library/Preferences/com.apple.loginwindow LoginwindowText -string "Email: [email protected]" | |
# Make sure auto login is disabled | |
sudo defaults delete /Library/Preferences/com.apple.loginwindow autoLoginUser 2> /dev/null | |
# Restart automatically if the computer freezes | |
sudo systemsetup -setrestartfreeze on | |
# Check for software updates daily, not just once per week | |
defaults write com.apple.SoftwareUpdate ScheduleFrequency -int 1 | |
# Disable smart quotes as they’re annoying when typing code | |
defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false | |
# Disable smart dashes as they’re annoying when typing code | |
defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false | |
# Set the clock settings (System Preferences → Date & Time → Clock) | |
defaults write com.apple.menuextra.clock DateFormat -string "d MMM HH:mm" | |
defaults write com.apple.menuextra.clock FlashDateSeparators -bool false | |
defaults write com.apple.menuextra.clock IsAnalog -bool false | |
# Show the battery percentage | |
defaults write com.apple.menuextra.battery ShowPercent -string "YES" | |
############################################################################### | |
# Network # | |
############################################################################### | |
# Use Google's DNS servers | |
#sudo networksetup -setdnsservers Wi-Fi 8.8.8.8 8.8.4.4 | |
# Require admin auth to create computer-to-computer networks | |
sudo /usr/libexec/airportd prefs RequireAdminIBSS=YES | |
# Require admin auth to change networks | |
sudo /usr/libexec/airportd prefs RequireAdminNetworkChange=YES | |
# Require admin auth to turn wifi on and off | |
sudo /usr/libexec/airportd prefs RequireAdminPowerToggle=YES | |
############################################################################### | |
# Trackpad, mouse, keyboard, Bluetooth accessories, and input # | |
############################################################################### | |
# 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 | |
defaults write com.apple.AppleMultitouchTrackpad Clicking -bool true | |
# Trackpad: enable dragging | |
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Dragging -bool true | |
defaults write com.apple.AppleMultitouchTrackpad Dragging -bool true | |
# Enable full keyboard access for all controls (e.g. enable Tab in modal dialogs) | |
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3 | |
# Use scroll gesture with the Ctrl (^) modifier key to zoom | |
defaults write com.apple.universalaccess closeViewScrollWheelToggle -bool true | |
# Use the F-keys as standard function keys.. | |
defaults write NSGlobalDomain "com.apple.keyboard.fnState" -int 1 | |
# Set language and text formats | |
defaults write NSGlobalDomain AppleLanguages -array "en" "nb" "sv" | |
defaults write NSGlobalDomain AppleLocale -string "en_SE" | |
# Set the timezone; see `sudo systemsetup -listtimezones` for other values | |
sudo systemsetup -settimezone "Europe/Oslo" > /dev/null | |
# Disable auto-correct | |
defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false | |
# Stop iTunes from responding to the keyboard media keys | |
launchctl unload -w /System/Library/LaunchAgents/com.apple.rcd.plist 2> /dev/null | |
# Change "Move focus to next window" shortcut to Alt + Tab | |
/usr/libexec/PlistBuddy -c "Add :AppleSymbolicHotKeys:27 dict" ~/Library/Preferences/com.apple.symbolichotkeys.plist | |
/usr/libexec/PlistBuddy -c "Add :AppleSymbolicHotKeys:27:enabled bool true" ~/Library/Preferences/com.apple.symbolichotkeys.plist | |
/usr/libexec/PlistBuddy -c "Add :AppleSymbolicHotKeys:27:value dict" ~/Library/Preferences/com.apple.symbolichotkeys.plist | |
/usr/libexec/PlistBuddy -c "Add :AppleSymbolicHotKeys:27:value:type string standard" ~/Library/Preferences/com.apple.symbolichotkeys.plist | |
/usr/libexec/PlistBuddy -c "Add :AppleSymbolicHotKeys:27:value:parameters array" ~/Library/Preferences/com.apple.symbolichotkeys.plist | |
/usr/libexec/PlistBuddy -c "Add :AppleSymbolicHotKeys:27:value:parameters:0 integer 65535" ~/Library/Preferences/com.apple.symbolichotkeys.plist | |
/usr/libexec/PlistBuddy -c "Add :AppleSymbolicHotKeys:27:value:parameters:1 integer 48" ~/Library/Preferences/com.apple.symbolichotkeys.plist | |
/usr/libexec/PlistBuddy -c "Add :AppleSymbolicHotKeys:27:value:parameters:2 integer 524288" ~/Library/Preferences/com.apple.symbolichotkeys.plist | |
############################################################################### | |
# Screen # | |
############################################################################### | |
# 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 | |
# Enable subpixel font rendering on non-Apple LCDs | |
defaults write NSGlobalDomain AppleFontSmoothing -int 2 | |
# Enable HiDPI display modes (requires restart) | |
sudo defaults write /Library/Preferences/com.apple.windowserver DisplayResolutionEnabled -bool true | |
# Don't show mirroring options in the menu bar when available | |
defaults write com.apple.airplay showInMenuBarIfPresent -bool false | |
############################################################################### | |
# Finder # | |
############################################################################### | |
# Finder: allow quitting via ⌘ + Q; doing so will also hide desktop icons | |
defaults write com.apple.finder QuitMenuItem -bool true | |
# Finder: disable window animations and Get Info animations | |
defaults write com.apple.finder DisableAllAnimations -bool true | |
# Set Desktop as the default location for new Finder windows | |
# For other paths, use `PfLo` and `file:///full/path/here/` | |
defaults write com.apple.finder NewWindowTarget -string "PfLo" | |
defaults write com.apple.finder NewWindowTargetPath -string "file://${HOME}/" | |
# Show icons for hard drives, servers, and removable media on the desktop | |
defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool true | |
defaults write com.apple.finder ShowHardDrivesOnDesktop -bool true | |
defaults write com.apple.finder ShowMountedServersOnDesktop -bool true | |
defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool true | |
# Finder: show all filename extensions | |
defaults write NSGlobalDomain AppleShowAllExtensions -bool true | |
# Finder: show status bar | |
defaults write com.apple.finder ShowStatusBar -bool true | |
# Finder: show path bar | |
defaults write com.apple.finder ShowPathbar -bool true | |
# Display full POSIX path as Finder window title | |
defaults write com.apple.finder _FXShowPosixPathInTitle -bool true | |
# When performing a search, search the current folder by default | |
defaults write com.apple.finder FXDefaultSearchScope -string "SCcf" | |
# Disable the warning when changing a file extension | |
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false | |
# Enable spring loading for directories | |
defaults write NSGlobalDomain com.apple.springing.enabled -bool true | |
# Remove the spring loading delay for directories | |
defaults write NSGlobalDomain com.apple.springing.delay -float 0 | |
# Avoid creating .DS_Store files on network volumes | |
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true | |
# Automatically open a new Finder window when a volume is mounted | |
defaults write com.apple.frameworks.diskimages auto-open-ro-root -bool true | |
defaults write com.apple.frameworks.diskimages auto-open-rw-root -bool true | |
defaults write com.apple.finder OpenWindowForNewRemovableDisk -bool true | |
# Enable snap-to-grid for icons on the desktop and in other icon views | |
/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist | |
/usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist | |
/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist | |
# Use list view in all Finder windows by default | |
# Four-letter codes for the other view modes: `icnv`, `clmv`, `Flwv` | |
defaults write com.apple.finder FXPreferredViewStyle -string "Nlsv" | |
# Disable the warning before emptying the Trash | |
defaults write com.apple.finder WarnOnEmptyTrash -bool false | |
# Enable AirDrop over Ethernet and on unsupported Macs running Lion | |
defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool true | |
# Show the ~/Library folder | |
chflags nohidden ~/Library | |
############################################################################### | |
# Dock, Dashboard, and hot corners # | |
############################################################################### | |
# Set the icon size of Dock items to 36 pixels | |
defaults write com.apple.dock tilesize -int 36 | |
# Enable dock magnification | |
defaults write com.apple.dock magnification -bool true | |
# Set the maginification scale to 76 | |
defaults write com.apple.dock largesize -int 76 | |
# Set the dock to be positioned to the left | |
defaults write com.apple.dock orientation -string left | |
# Enable spring loading for all Dock items | |
defaults write com.apple.dock enable-spring-load-actions-on-all-items -bool true | |
# Wipe all (default) app icons from the Dock | |
defaults write com.apple.dock persistent-apps -array | |
# Don’t animate opening applications from the Dock | |
defaults write com.apple.dock launchanim -bool false | |
# Disable Dashboard | |
defaults write com.apple.dashboard mcx-disabled -bool true | |
# Don’t show Dashboard as a Space | |
defaults write com.apple.dock dashboard-in-overlay -bool true | |
# Don’t automatically rearrange Spaces based on most recent use | |
defaults write com.apple.dock mru-spaces -bool false | |
# Automatically hide and show the Dock | |
defaults write com.apple.dock autohide -bool true | |
# Reset Launchpad, but keep the desktop wallpaper intact | |
find "${HOME}/Library/Application Support/Dock" -name "*-*.db" -maxdepth 1 -delete | |
# Hot corners | |
# Possible values: | |
# 0: no-op | |
# 2: Mission Control | |
# 3: Show application windows | |
# 4: Desktop | |
# 5: Start screen saver | |
# 6: Disable screen saver | |
# 7: Dashboard | |
# 10: Put display to sleep | |
# 11: Launchpad | |
# 12: Notification Center | |
# Top left screen corner → Mission Control | |
#defaults write com.apple.dock wvous-tl-corner -int 2 | |
#defaults write com.apple.dock wvous-tl-modifier -int 0 | |
# Top right screen corner → Start screen saver | |
defaults write com.apple.dock wvous-tr-corner -int 5 | |
defaults write com.apple.dock wvous-tr-modifier -int 0 | |
# Bottom left screen corner → Start screen saver | |
#defaults write com.apple.dock wvous-bl-corner -int 5 | |
#defaults write com.apple.dock wvous-bl-modifier -int 0 | |
############################################################################### | |
# Safari & WebKit # | |
############################################################################### | |
# Privacy: don’t send search queries to Apple | |
defaults write com.apple.Safari UniversalSearchEnabled -bool false | |
defaults write com.apple.Safari SuppressSearchSuggestions -bool true | |
# Press Tab to highlight each item on a web page | |
defaults write com.apple.Safari WebKitTabToLinksPreferenceKey -bool true | |
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2TabsToLinks -bool true | |
# Show the full URL in the address bar (note: this still hides the scheme) | |
defaults write com.apple.Safari ShowFullURLInSmartSearchField -bool true | |
# Set Safari’s home page to `about:blank` for faster loading | |
defaults write com.apple.Safari HomePage -string "about:blank" | |
# Prevent Safari from opening ‘safe’ files automatically after downloading | |
defaults write com.apple.Safari AutoOpenSafeDownloads -bool false | |
# Allow hitting the Backspace key to go to the previous page in history | |
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2BackspaceKeyNavigationEnabled -bool true | |
# Hide Safari’s bookmarks bar by default | |
defaults write com.apple.Safari ShowFavoritesBar -bool false | |
# Hide Safari’s sidebar in Top Sites | |
defaults write com.apple.Safari ShowSidebarInTopSites -bool false | |
# Disable Safari’s thumbnail cache for History and Top Sites | |
defaults write com.apple.Safari DebugSnapshotsUpdatePolicy -int 2 | |
# Enable Safari’s debug menu | |
defaults write com.apple.Safari IncludeInternalDebugMenu -bool true | |
# Make Safari’s search banners default to Contains instead of Starts With | |
defaults write com.apple.Safari FindOnPageMatchesWordStartsOnly -bool false | |
# Remove useless icons from Safari’s bookmarks bar | |
defaults write com.apple.Safari ProxiesInBookmarksBar "()" | |
# Enable the Develop menu and the Web Inspector in Safari | |
defaults write com.apple.Safari IncludeDevelopMenu -bool true | |
defaults write com.apple.Safari WebKitDeveloperExtrasEnabledPreferenceKey -bool true | |
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2DeveloperExtrasEnabled -bool true | |
# Add a context menu item for showing the Web Inspector in web views | |
defaults write NSGlobalDomain WebKitDeveloperExtras -bool true | |
############################################################################### | |
# Firewall # | |
############################################################################### | |
# Application Level Firewall state. | |
# Possible value: | |
# 0: Disabled | |
# 1: Enabled | |
# 2: Enabled & blocking all incoming connections | |
sudo defaults write /Library/Preferences/com.apple.alf globalstate -int 2 | |
# Allow signed apps | |
sudo defaults write /Library/Preferences/com.apple.alf allowsignedenabled -bool true | |
# Enable logging | |
sudo defaults write /Library/Preferences/com.apple.alf loggingenabled -bool true | |
# Enable stealth mode | |
sudo defaults write /Library/Preferences/com.apple.alf stealthenabled -bool true | |
############################################################################### | |
# Location Services # | |
############################################################################### | |
# Show location icon in menu bar when System Services request your location | |
sudo defaults write /Library/Preferences/com.apple.locationmenu ShowSystemServices -bool true | |
############################################################################### | |
# Spotlight # | |
############################################################################### | |
# Disable Spotlight hotkey | |
/usr/libexec/PlistBuddy -c "Add :AppleSymbolicHotKeys:64 dict" ~/Library/Preferences/com.apple.symbolichotkeys.plist | |
/usr/libexec/PlistBuddy -c "Add :AppleSymbolicHotKeys:64:enabled bool" ~/Library/Preferences/com.apple.symbolichotkeys.plist | |
/usr/libexec/PlistBuddy -c "Set :AppleSymbolicHotKeys:64:enabled false" ~/Library/Preferences/com.apple.symbolichotkeys.plist | |
############################################################################### | |
# Alfred # | |
############################################################################### | |
# Set the config sync folder | |
defaults write com.runningwithcrayons.Alfred-Preferences-3 syncfolder -string "~/Dropbox/Library/Alfred" | |
#TODO: Configuring colour scheme and key binding | |
############################################################################### | |
# Terminal # | |
############################################################################### | |
# Only use UTF-8 in Terminal.app | |
defaults write com.apple.terminal StringEncodings -array 4 | |
# Enable Secure Keyboard Entry | |
defaults write com.apple.terminal SecureKeyboardEntry -bool true | |
############################################################################### | |
# Time Machine # | |
############################################################################### | |
# Prevent Time Machine from prompting to use new hard drives as backup volume | |
defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool true | |
############################################################################### | |
# Activity Monitor # | |
############################################################################### | |
# Show the main window when launching Activity Monitor | |
defaults write com.apple.ActivityMonitor OpenMainWindow -bool true | |
# Visualize CPU usage in the Activity Monitor Dock icon | |
defaults write com.apple.ActivityMonitor IconType -int 5 | |
# Show all processes in Activity Monitor | |
defaults write com.apple.ActivityMonitor ShowCategory -int 0 | |
# Sort Activity Monitor results by CPU usage | |
defaults write com.apple.ActivityMonitor SortColumn -string "CPUUsage" | |
defaults write com.apple.ActivityMonitor SortDirection -int 0 | |
############################################################################### | |
# Address Book, Dashboard, iCal, TextEdit, and Disk Utility # | |
############################################################################### | |
# Enable the debug menu in Address Book | |
defaults write com.apple.addressbook ABShowDebugMenu -bool true | |
# Enable Dashboard dev mode (allows keeping widgets on the desktop) | |
defaults write com.apple.dashboard devmode -bool true | |
# Enable the debug menu in iCal (pre-10.8) | |
defaults write com.apple.iCal IncludeDebugMenu -bool true | |
# Use plain text mode for new TextEdit documents | |
defaults write com.apple.TextEdit RichText -int 0 | |
# Open and save files as UTF-8 in TextEdit | |
defaults write com.apple.TextEdit PlainTextEncoding -int 4 | |
defaults write com.apple.TextEdit PlainTextEncodingForWrite -int 4 | |
# Enable the debug menu in Disk Utility | |
defaults write com.apple.DiskUtility DUDebugMenuEnabled -bool true | |
defaults write com.apple.DiskUtility advanced-image-options -bool true | |
############################################################################### | |
# Mac App Store # | |
############################################################################### | |
# Enable the WebKit Developer Tools in the Mac App Store | |
defaults write com.apple.appstore WebKitDeveloperExtras -bool true | |
# Enable Debug Menu in the Mac App Store | |
defaults write com.apple.appstore ShowDebugMenu -bool true | |
# Disable gamed from continously spamming Apple's servers | |
defaults write com.apple.gamed Disabled -bool true | |
############################################################################### | |
# Google Chrome # | |
############################################################################### | |
# Disable the all too sensitive backswipe on trackpads | |
defaults write com.google.Chrome AppleEnableSwipeNavigateWithScrolls -bool false | |
# Disable the all too sensitive backswipe on Magic Mouse | |
defaults write com.google.Chrome AppleEnableMouseSwipeNavigateWithScrolls -bool false | |
############################################################################### | |
# Spectacle.app # | |
############################################################################### | |
# Enable automatic update checks | |
defaults write com.divisiblebyzero.Spectacle SUEnableAutomaticChecks -bool true | |
# Hide icon in menu bar | |
defaults write com.divisiblebyzero.Spectacle StatusItemEnabled -bool false | |
############################################################################### | |
# Caffeine # | |
############################################################################### | |
# Do not activate on launch | |
defaults write com.lightheadsw.caffeine ActivateOnLaunch -bool false | |
# Set the default duration to one hour | |
defaults write com.lightheadsw.caffeine DefaultDuration -int 60 | |
# Do not show launch message | |
defaults write com.lightheadsw.caffeine SuppressLaunchMessage -bool true | |
############################################################################### | |
# iStat Menus # | |
############################################################################### | |
# Orange graphs | |
defaults write com.bjango.istatmenus6.extras MenubarSkinColor-Dark -int 1 | |
# Black dropdown theme | |
defaults write com.bjango.istatmenus6.extras DropdownTheme-Dark -int 1 | |
# Slow update frequency | |
defaults write com.bjango.istatmenus6.extras TimerFrequency -int 0 | |
############################################################################### | |
# Todoist # | |
############################################################################### | |
# Show in Dock, but not in the menubar | |
defaults write "com.todoist.mac.Todoist" ShowInDock -bool true | |
defaults write "com.todoist.mac.Todoist" ShowTodoistMenuBar -bool false | |
############################################################################### | |
# Little Snitch & Micro Snitch # | |
############################################################################### | |
# Don't show the warning when closing Little Snitch configuration | |
defaults write "at.obdev.LittleSnitchConfiguration" ShowTerminationAlert -int 0 | |
#TODO: disable default keyboard shortcut | |
# Set Micro Snitch to open at login | |
defaults write "at.obdev.MicroSnitch" OpenAtLogin -int 1 | |
############################################################################### | |
# Arduino # | |
############################################################################### | |
if [ -f ${HOME}/Library/Arduino15/preferences.txt ]; then | |
sed -i "s|sketchbook.path=.*|sketchbook.path=${HOME}/Projects/arduino|g" ${HOME}/Library/Arduino15/preferences.txt | |
fi | |
############################################################################### | |
# Dash # | |
############################################################################### | |
defaults write com.kapeli.dashdoc syncFolderPath -string "${HOME}/Dropbox/Library/Dash" | |
defaults write com.kapeli.dashdoc snippetSQLPath -string "${HOME}/Dropbox/Library/Dash/Snippets.dash" | |
############################################################################### | |
# Login Items # | |
############################################################################### | |
# Clear all login items... | |
LOGIN_ITEMS=$(osascript -e 'tell application "System Events" to get every login item') | |
IFS=', ' read -r -a LOGIN_ITEMS_ARRAY <<< "${LOGIN_ITEMS//login item /}" | |
for item in "${LOGIN_ITEMS_ARRAY[@]}"; do | |
osascript -e "tell application \"System Events\" to delete every login item whose name is \"${item}\"" | |
done | |
# ...and add those I want | |
osascript -e 'tell application "System Events" to make login item at end with properties {path:"/Applications/Alfred 3.app", name:"Alfred 3", hidden:false}' | |
osascript -e 'tell application "System Events" to make login item at end with properties {path:"/Applications/Caffeine.app", name:"Caffeine", hidden:false}' | |
osascript -e 'tell application "System Events" to make login item at end with properties {path:"/Applications/Dropbox.app", name:"Dropbox", hidden:false}' | |
osascript -e 'tell application "System Events" to make login item at end with properties {path:"/Applications/Spectacle.app", name:"Spectacle", hidden:false}' | |
############################################################################### | |
# Wrap up... # | |
############################################################################### | |
# Run the common scripts... | |
/usr/bin/env bash <(curl -fsSL https://gist.githubusercontent.com/hedlund/89cf18b500e7c97eab807f02f173905b/raw) | |
# Output some useful info... | |
printf "\nRemember to enable Accessibility access for the following applications:\n" | |
printf " Alfred 3\n" | |
printf " Dropbox\n" | |
printf " Spectacle\n" | |
printf "Go to System Preferences > Security & Privacy > Privacy > Accessibility\n\n" | |
printf "Login to 1Password to get the passwords syncing.\n" | |
printf "Login to Dropbox and let it finish the first sync.\n" | |
printf "Then install Little Snitch and let it restart the computer...\n\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment