Skip to content
Browse files

initial commit

  • Loading branch information...
smitmartijn committed Mar 19, 2019
0 parents commit 09e483f2144c48586014a2d0dae2868b962830a7
Showing with 370 additions and 0 deletions.
  1. +18 −0
  2. +6 −0
  3. +173 −0
  4. +11 −0 dotfiles/pino.bash_profile
  5. +19 −0 dotfiles/
  6. +143 −0
  7. 0 offline-apps/EMPTY
@@ -0,0 +1,18 @@
# MacOS Setup Scripts

These scripts complete my MacOS configuration by changing a bunch of MacOS settings ( and installing my base applications ( and then configuring a few apps (

This is completely catered to my own taste and installs applications that I use. If you're like to use this form of automated install, go over each script and have a look at the settings it configures and the apps that it installs to personalise it to your needs.

These scripts will work on a freshly installed MacOS device. It uses [Homebrew]( and the [Mac App Store CLI]( to install applications.

There's also the directory 'offline-apps/' and the script runs to all downloaded .pkg files and installs them as well. At the bottom of is also a list of URLs to DMG files that it will download, mount and detect whether to just move it to /Applications or use the installer cli.

# Steps

@@ -0,0 +1,6 @@
#! /usr/bin/env bash

# Apply application settings

cp ~/Dropbox/MacOS-Setup/dotfiles/$HOST.bash_profile ~/.bash_profile
cp ~/Dropbox/MacOS-Setup/dotfiles/$ ~/.zshrc
@@ -0,0 +1,173 @@
#! /usr/bin/env bash

# Apply machine hostname
read -p "What is this machine's label (Example: \"ernie\")? " mac_os_label
if [[ -z "$mac_os_label" ]]; then
printf "ERROR: Invalid MacOS label.\n"
exit 1

read -p "What is this machine's name (Example: \"ernie\")? " mac_os_name
if [[ -z "$mac_os_name" ]]; then
printf "ERROR: Invalid MacOS name.\n"
exit 1

printf "Setting system label and name...\n"
sudo scutil --set ComputerName $mac_os_label
sudo scutil --set HostName $mac_os_name
sudo scutil --set LocalHostName $mac_os_name
sudo defaults write /Library/Preferences/SystemConfiguration/ NetBIOSName -string $mac_os_name

printf "Getting rid of enrollment agent..\n"
sudo launchctl remove
sudo launchctl unload

printf "Disabling guest user..\n"
sudo dscl . -delete /Users/Guest
sudo security delete-generic-password -a Guest -s -D "application password" /Library/Keychains/System.keychain
sudo defaults write /Library/Preferences/ GuestEnabled -bool FALSE

# Applies system and application defaults.

printf "System - Enaling Dark mode\n"
defaults write NSGlobalDomain AppleInterfaceStyle Dark

printf "System - Disable boot sound effects\n"
sudo nvram SystemAudioVolume=" "

printf "System - Expand save panel by default\n"
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true

printf "System - Disable the 'Are you sure you want to open this application?' dialog\n"
defaults write LSQuarantine -bool false

printf "System - Disable auto-correct\n"
defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false

printf "System - Disable smart quotes (not useful when writing code)\n"
defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false

printf "System - Disable smart dashes (not useful when writing code)\n"
defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false

printf "System - Require password immediately after sleep or screen saver begins\n"
defaults write askForPassword -int 1
defaults write askForPasswordDelay -int 0

printf "System - Hot Corner: Bottom Right - Put display to sleep"
defaults write ~/Library/Preferences/ wvous-br-corner -int 10
defaults write ~/Library/Preferences/ wvous-br-modifier -int 0

printf "System - Avoid creating .DS_Store files on network & USB volumes\n"
defaults write DSDontWriteNetworkStores -bool true
defaults write DSDontWriteUSBStores -bool true

printf "System - Don't chime when power is plugged in\n"
defaults write ChimeOnAllHardware -bool false

printf "System - Disable autocorrect\n"
defaults write -g NSAutomaticSpellingCorrectionEnabled -bool false

printf "System - Disable Bonjour\n"
sudo defaults write /System/Library/LaunchDaemons/ ProgramArguments -array-add "-NoMulticastAdvertisements"

printf "Bluetooth - Increase sound quality for headphones/headsets\n"
defaults write "Apple Bitpool Min (editable)" -int 40

printf "Dock - Remove all default app icons\n"
defaults write persistent-apps -array

printf "Dock - Don't show recently used apps"
defaults write show-recents -bool false

printf "Dock - Automatically hide and show\n"
defaults write autohide -bool true

printf "Dock - Remove the auto-hiding delay\n"
defaults write autohide-delay -float 0

printf "Dock - Title size and magnification\n"
defaults write magnification -bool true
defaults write tilesize -int 48
defaults write largesize -int 64

printf "Dock - Don’t show Dashboard as a Space\n"
defaults write "dashboard-in-overlay" -bool true

printf "iCloud - Save to disk by default\n"
defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false

printf "Finder - Show the $HOME/Library folder\n"
chflags nohidden $HOME/Library

printf "Finder - Show hidden files\n"
defaults write AppleShowAllFiles -bool true

printf "Finder - Show filename extensions\n"
defaults write NSGlobalDomain AppleShowAllExtensions -bool true

printf "Finder - Disable the warning when changing a file extension\n"
defaults write FXEnableExtensionChangeWarning -bool false

printf "Finder - Show path bar\n"
defaults write ShowPathbar -bool true

printf "Finder - Show status bar\n"
defaults write ShowStatusBar -bool true

printf "Finder - Use list view in all Finder windows\n"
defaults write FXPreferredViewStyle -string "Nlsv"

printf "Finder - Allow text selection in Quick Look\n"
defaults write QLEnableTextSelection -bool true

printf "Safari - Set home page to 'about:blank' for faster loading\n"
defaults write HomePage -string "about:blank"

printf "Safari - Use Contains instead of Starts With in search banners\n"
defaults write FindOnPageMatchesWordStartsOnly -bool false

printf "Safari - Enable debug menu\n"
defaults write IncludeInternalDebugMenu -bool true

printf "Safari - Enable the Develop menu and the Web Inspector\n"
defaults write IncludeDevelopMenu -bool true
defaults write WebKitDeveloperExtrasEnabledPreferenceKey -bool true
defaults write -bool true

printf "Safari - Add a context menu item for showing the Web Inspector in web views\n"
defaults write NSGlobalDomain WebKitDeveloperExtras -bool true

printf "Safari - Disable sending search queries to Apple.\n"
defaults write UniversalSearchEnabled -bool false

printf "Chrome - Prevent native print dialog, use system dialog instead\n"
defaults write DisablePrintPreview -boolean true

printf "TextEdit - Use plain text mode for new documents\n"
defaults write RichText -int 0

printf "TextEdit - Open and save files as UTF-8 encoding\n"
defaults write PlainTextEncoding -int 4
defaults write PlainTextEncodingForWrite -int 4

printf "Trackpad - Disable natural scroll\n"
defaults write -g -bool NO

printf "Printer - Expand print panel by default\n"
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true

printf "Printer - Automatically quit printer app once the print jobs complete\n"
defaults write "Quit When Finished" -bool true

printf "Game Center - Disable Game Center\n"
defaults write Disabled -bool true

printf "App Store - Enable the WebKit Developer Tools in the Mac App Store\n"
defaults write WebKitDeveloperExtras -bool true

printf "App Store - Enable Debug Menu in the Mac App Store\n"
defaults write ShowDebugMenu -bool true

printf "You should reboot now\n"
@@ -0,0 +1,11 @@

export EDITOR=nano
export PATH="/usr/local/bin:$PATH"

# Display git branch in path
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
export PS1="\u@\h \[\033[32m\]\w\[\033[33m\]\$(parse_git_branch)\[\033[00m\] $ "

@@ -0,0 +1,19 @@
# Load extensions
source /usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh
source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

# Activate plugins
plugins=(git zsh-completions)

# Custom paths

# Custom vars
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8

# Set default editor
export EDITOR='nano'

# Theme
@@ -0,0 +1,143 @@
#! /usr/bin/env bash

# Installs Homebrew software.

if ! command -v brew > /dev/null; then
ruby -e "$(curl --location --fail --show-error"
export PATH="/usr/local/bin:$PATH"
printf "export PATH=\"/usr/local/bin:$PATH\"\n" >> $HOME/.bash_profile

printf "Updating brew\n"
brew upgrade && brew update

printf "Installing xcode cli utils\n"
xcode-select --install

printf "brew: Installing cli packages\n"
brew install git
brew install gpg
brew install mas # Apple store cli
brew install node # NodeJS dev
brew install openssl # Generate certificates
brew install ruby-install
brew install terraform # Automation
brew install vim # Guilty pleasure
brew install watch
brew install wakeonlan
brew install wget

# Install ZSH and Oh My ZSH
brew install zsh zsh-completions zsh-autosuggestions zsh-syntax-highlighting

chsh -s /usr/local/bin/zsh
sh -c "$(curl -fsSL"

printf "brew: Installing apps\n"
brew cask install 1password
brew cask install 1password-cli
brew cask install bartender
brew cask install dropbox
brew cask install docker
brew cask install evernote
brew cask install firefox
brew cask install franz
brew cask install google-chrome
brew cask install grammarly
brew cask install handbrake
brew cask install istat-menus
brew cask install iterm2
brew cask install java
brew cask install keybase
brew cask install ngrok
brew cask install nordvpn
brew cask install postman
brew cask install powershell
brew cask install slack
brew cask install spotify
brew cask install tor-browser
brew cask install tuxera-ntfs
brew cask install rescuetime
brew cask install royal-tsx
brew cask install visual-studio-code
brew cask install vlc
brew cask install vmware-fusion
brew cask install wireshark
brew cask install wifi-explorer
brew cask install zoomus
brew cask install zoomus-outlook-plugin
brew cask install xmind-zen

# Installs App Store software.

if ! command -v mas > /dev/null; then
printf "ERROR: Mac App Store CLI (mas) can't be found.\n"
printf " Please ensure Homebrew and mas (i.e. brew install mas) have been installed first."
exit 1

printf "AppStore: Installing The Unarchiver\n"
mas install 425424353

printf "AppStore: Installing Todoist\n"
mas install 585829637

printf "AppStore: Installing Tweetbot 3\n"
mas install 1384080005

printf "AppStore: Installing Microsoft Remote Desktop 10\n"
mas install 1295203466

printf "AppStore: Installing Microsoft OneDrive\n"
mas install 823766827

printf "AppStore: Installing Microsoft OneNote\n"
mas install 784801555

printf "AppStore: Installing Microsoft Excel\n"
mas install 462058435

printf "AppStore: Installing Microsoft Outlook\n"
mas install 985367838

printf "AppStore: Installing Microsoft Word\n"
mas install 462054704

printf "AppStore: Installing Microsoft PowerPoint\n"
mas install 462062816

printf "Installing offline apps..\n"
for f in offline-apps/*.pkg ;
do sudo installer -pkg "$f" -target /

printf "Downloading and installing apps via .dmg links..\n"

for i in "${URLs[@]}";
wget -P ~/Downloads/ "$i"
DMG=$(echo $i | rev | cut -d / -f 1 | rev)
VOL=$(hdiutil attach ~/Downloads/$DMG | grep -i '/Volumes/' | awk -F " " '{print $3}')

if [ -e "$VOL"/*.app ]; then
sudo cp -rf "$VOL"/*.app /Applications/
elif [ -e "$VOL"/*.pkg ]; then
package=$(ls -1 "$VOL" | grep .pkg | head -1)
sudo installer -pkg "$VOL"/"$package" -target /
elif [ -e "$VOL"/*.mpkg ]; then
package=$(ls -1 "$VOL" | grep .mpkg | head -1)
sudo installer -pkg "$VOL"/"$package" -target /

hdiutil unmount "$VOL"
No changes.

0 comments on commit 09e483f

Please sign in to comment.
You can’t perform that action at this time.