├── ssh-config-file-example.txt ├── vscodesettings.json ├── README.md ├── LICENSE └── macbook-initial-setup.sh /ssh-config-file-example.txt: -------------------------------------------------------------------------------- 1 | Host * 2 | IdentityFile ~/.ssh/id_rsa 3 | UseKeychain yes 4 | AddKeysToAgent yes 5 | 6 | Host someserver.com 7 | User username 8 | PreferredAuthentications publickey 9 | IdentityFile ~/.ssh/private-key-name 10 | UseKeychain yes 11 | AddKeysToAgent yes 12 | 13 | Host retropie 14 | HostName 10.X.X.XX 15 | User pi 16 | -------------------------------------------------------------------------------- /vscodesettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "telemetry.telemetryLevel": "off", 3 | "github.gitAuthentication": false, 4 | "search.useIgnoreFiles": false, 5 | "workbench.colorTheme": "Default Light+", 6 | "editor.fontFamily": "'SF Mono', Menlo, Monaco, 'Courier New', monospace", 7 | "workbench.startupEditor": "newUntitledFile", 8 | "workbench.colorCustomizations": { 9 | "terminal.ansiBrightBlue": "#6871ff" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 🖥🏗 MacOS setup 2 | Scripts for setting up a brand new MacOS, and getting it ready to work in no time 3 | 4 | ## Installation 5 | 1. Download this repo: `$ git clone git@github.com:vol24pl/MacOS-setup.git` 6 | 2. Add permissions to execute the script: `$ chmod +x ./macbook-initial-setup.sh` 7 | 3. **Edit this script to your own liking**: `$ nano ./macbook-initial-setup.sh` 8 | 4. Run the script: `$ ./macbook-initial-setup.sh` 9 | 10 | ## Additional (optional) steps after the install 11 | 12 | - [ ] Edit template `ssh-config-file-example.txt` and copy it to `~/.ssh/config` 13 | 14 | - [ ] Change monotype font everywhere to: `SF Mono 12` 15 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Adrian Zyga 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /macbook-initial-setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # install homebrew apps repositories manager 4 | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" 5 | 6 | # Run these two commands in your terminal to add Homebrew to your PATH: 7 | # Add on each boot 8 | (echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/$USER/.zprofile 9 | # Add now 10 | eval "$(/opt/homebrew/bin/brew shellenv)" 11 | 12 | # add repo with drivers to cask (needed for Steelseries Engine, Logitech Camera Settings, Logitech G-Hub) 13 | # brew tap homebrew/cask-drivers 14 | 15 | # List of Apps that have to be downloaded by hand ⚠️ This script only prints them! 16 | appsToDownloadList=( 17 | DaVinci-Resolve # The best free video editor 18 | ) 19 | echo "⚠️ Please download this apps by hand: ${appsToDownloadList[@]}" 20 | 21 | # List of non-AppStore apps 22 | nonAppStoreApps=( 23 | #Browsers 24 | firefox # Most popular open source browser 25 | brave-browser # Open Source replacement for the Google Chrome with built in adblockers 26 | tor-browser # Browser preconfigured with TOR network 27 | #Developer 28 | rapidapi # MacOS native HTTP requests tool (Paw is an old name for the same App). 29 | visual-studio-code # Electron-based code editor with community-driven plugins developed by Microsoft 30 | tableplus # Modern SQL client 31 | bbedit # Most stable macOS text editor that can handle huge files 32 | proxyman # Web debugging proxy 33 | mactex # Full LateX installation with supporting apps, about 4GB! 34 | sketch # UI/UX design tool 35 | zeplin # UI/UX design viewer 36 | typora # Markdown single pane editor 37 | fork # Modern GUI for git and gitflow 38 | cyberduck # FTP client 39 | #SECURITY 40 | protonvpn # VPN from ProtonMail 41 | 1password # Password Manager. Use this instead of the deprecated one on the App Store. 42 | #HDD 43 | daisydisk # Daisy Disk (App for recovering disk space) 44 | mounty # NTFS file system write without hassle. No drivers, no kext. 45 | drivedx # SMART status and HDD health tool 46 | #Video 47 | iina # Best looking macOS video watching app 48 | vlc # Most popular cross-platform video watching app 49 | handbrake # Video Transcoder 50 | #Graphics 51 | paintbrush # Simple Microsoft Paint-like drawing tool #WARNING: It changes images DPI! 52 | gimp # Graphics editor 53 | #Subtitles 54 | flixtools # Subtitles downloader 55 | #OTHER 56 | signal # End-to-end encrypted messenger 57 | skype # Communicator 58 | monitorcontrol # Monitor control works with media keys to set brightness of the display and HDMI output sounds volume 59 | keka # Rar extractor 60 | libreoffice # Documents/spreadsheets/presentations editor 61 | utm # Virtual Machine frontend working with ARM M1 cpu. QEMU under the hood. 62 | scroll-reverser # Reverse scrolling setting separate for touchpad and mouse. Use instead of bettertouchtool 63 | discord # Text and audio chat 64 | calibre # Mobi/epub e-book converter 65 | protonmail-bridge # Bridge for email clients to work with ProtonMail 66 | transmission # Torrents client 67 | #Audio 68 | cog # Music and audio player 69 | spotify # Most popular music streaming service 70 | #Unused by me, but worth considering 71 | # Apps that makes sens only for x86 72 | # virtualbox # Virtual Machine that can virtualize if you have x86 CPU 73 | # virtualbox-extension-pack # Extensions for virtualbox such as display resolution and USB 74 | # Requires Rosetta 2, not for M1 purist :) 75 | # For details look at https://doesitarm.com 76 | # sdformatter # SD card formatter recommended by SD Association 77 | # logitech-g-hub # Mouse/Keyobard/Camera drivers for Logitech devices 78 | # logitech-camera-settings # Drivers for the webcamera. Included in logitech-g-hub 79 | # authy # 2-factor authenticator # Not ARM ready. For M1 Use this instead https://apps.apple.com/pl/app/twilio-authy/id494168017 80 | # aegisub # Subtitles editor 81 | # musicbrainz-picard # Audio tags editor 82 | # ApplePi-Baker # App for making the binary image copies of the whole drives 83 | # balenaetcher # creating USB drives 84 | # raspberry-pi-imager # creating images for Raspberry Pi 85 | # Not signed 86 | # xld # Audio converter 87 | # isimulator # App to manage iOS Simulators 88 | # Requires KEXT: 89 | # paragon-ntfs # NTFS file system support 90 | #Games: WARNING Most games are 32-bit and won't work on Catalina or above 91 | # steam # Biggest gaming platform from Valve 92 | # gog-galaxy # Gaming platform with huge retro library from CD-Projekt 93 | # battle-net # Blizzard's gaming platform 94 | # origin # EA's gaming platform 95 | # epic-games # Epic's gaming platform 96 | #Developer 97 | # pycharm-ce # Python IDE from JetBrains (community edition) 98 | # webstorm # JavaScript IDE from JetBrains 99 | # intellij-idea-ce # Java IDE from JetBrains (community edition) 100 | # sublime-text # Cross-platform code editor with it's own high performance rendering engine 101 | # atom # Electron-based code editor with community-driven plugins developed by Github 102 | # macdown # Markdown 2 panes editor 103 | # dotnet-sdk # Dotnet language support 104 | # docker # App to make containers for environments 105 | # postman # Most popular HTTP requests tool 106 | # charles # Web debugging proxy 107 | # insomnia # Electron-based open source HTTP requests tool 108 | # reveal # App to edit iOS Views on the fly 109 | # iterm2 # Alternative terminal 110 | # sourcetree # GUI for git and gitflow. Use Fork instead as Fork does not have problems with GPG keys ;) 111 | # avocode # UI/UX design tool 112 | #Other 113 | # steelseries-gg # Steelseries mouse drivers + bloatware. I'm done with Steelseries^^ 114 | # bettertouchtool # Custom gestures for touchpad and touchbar, and reverse scrolling setting separate for touchpad and mouse. 115 | # linein # App for redirecting macOS audio between sources (Audio Play-Thru). This may not work with Big Sur. Look at https://www.rogueamoeba.com for alternatives. 116 | # blackhole-2ch # App giving additional audio sources for audio manipulation (2 channels) / Alternative to Soundflower for ARM Macs 117 | # blackhole-16ch # App giving additional audio sources for audio manipulation (16 channels) / Alternative to Soundflower for ARM Macs 118 | # anki # App for learning with flashcards 119 | # zoom # Video conference App 120 | # xquartz # X11 windows server needed for wine 121 | # wine-stable # App to open Windows .exe files 122 | # spotify # Music streaming service 123 | # thunderbird # Open Source Email client 124 | # heaven # Popular GPU Benchmark 125 | # little-snitch # Blocker for app's unwanted Internet traffic 126 | ) 127 | 128 | # To get Discord for M1 before it's supported in the main version 129 | brew tap homebrew/cask-versions 130 | brew install --cask discord-canary 131 | 132 | # install non-AppStore apps 133 | brew install --cask ${nonAppStoreApps[@]} 134 | 135 | # Install Battle.net (additional step for battle-net cask) 136 | # open /usr/local/Caskroom/battle-net/latest/Battle.net-Setup.app 137 | 138 | # Install AppStore CLI installer 139 | brew install mas 140 | 141 | # list of AppStore apps 142 | appStoreApps=( 143 | 593341977 # PDF Attributes (PDF metadata editor) 144 | 497799835 # Xcode (Apple IDE) 145 | 1569813296 # 1Password for Safari (Extension for Safari, as the built-in one was deprecated) 146 | 1091189122 # Bear (Notes with markdown support) 147 | 904280696 # Things 3 (TODO app) 148 | 1335413823 # Ka-Block! (Ads blocking Safari extension) 149 | 1544743900 # Hush (Safari extension that hides cookies consent popups) 150 | 803453959 # Slack (Communicator) 151 | 462054704 # Microsoft Word (Documents editor) 152 | 462058435 # Microsoft Excel (Spreadsheets editor) 153 | 462062816 # Microsoft PowerPoint (Presentations editor) 154 | 409201541 # Pages (Apple's documents editor) 155 | 409203825 # Numbers (Apple's spreadsheets editor) 156 | 409183694 # Keynote (Apple's presentations editor) 157 | 425424353 # The Unarchiver (Archives extractor) 158 | 430798174 # HazeOver (App that dims unfocused windows) 159 | 1388020431 # DevCleaner for Xcode (App for deleting old Xcode files in ~/Library/Developer folder) 160 | 425264550 # Blackmagic HDD Speed test benchmark 161 | 1352778147 # Bitwarden 162 | 1484801884 # Pomodoro timer 163 | 441258766 # Magnet. Tool to have a Windows7-like window management by dragging windows. Use instead of bettertouchtool 164 | 972028355 # Micro Snitch. App to monitor the activity of camera and microphone 165 | 688211836 # EasyRes (resolution changer for retina) 166 | 1295203466 # Microsoft Remote Desktop. Best remote desktop for controlling Windows PC 167 | 1168254295 # AmorphousDiskMark. HDD benchmarking tool based on well known CrystalDiskMark 168 | #Unused 169 | # 417375580 # Better Snap Tool. Use instead of Magnet if the latter is too expensive. 170 | # 682658836 # Garage Band (App for creating and learning music) 171 | # 408981434 # iMovie (App for filmmaking) 172 | # 405399194 # Kindle (Mobi file format reader) 173 | # 985367838 # Microsoft Outlook (Email client) 174 | # 673660806 # Controllers Lite (Gamepads diagnostics app) 175 | # 1466185689 # Blackmagic CPU/GPU speed benchmark 176 | # 975937182 # Fantastical (Calendar app) 177 | # 1438310985 # SimplePing - too see if you have a connection on Status menus. Paid but M1 compatible! 178 | # Requires Rosetta 2, not for M1 purist :) 179 | # 1158928913 # PingStatus - too see if you have a connection on Status menus 180 | # 1081413713 # GIF Brewery 3 (Recording screen or camera stream as a GIF) 181 | # 768053424 # Gapplin (Vector images viewer/converter) 182 | # 425955336 # Skitch (App for marking pictures) 183 | # 929507092 # PhotoScape X (Photo Editor) 184 | # 1480068668 # Facebook Messenger 185 | # 1278508951 # Trello (Project management tool) 186 | # 957734279 # Toggl (Time tracking app) 187 | # 1007457278 # Realm Browser (Realm databases browser) 188 | # 1246969117 # Steam Link (Playing Steam games from remote PC on this macOS) 189 | ) 190 | 191 | # Install AppStore apps 192 | # WARNING: This tool can only reinstall apps that are already tied to you account. If you're downloading something for the first time do it through AppStore 193 | mas install ${appStoreApps[@]} 194 | 195 | # Install terminal colors for Bash (choose between light and dark theme) 196 | echo -e "export CLICOLOR=1\n#light theme\nexport LSCOLORS=ExFxBxDxCxegedabagacad\n#dark theme\n#export LSCOLORS=GxFxCxDxBxegedabagaced" >> ~/.bash_profile 197 | 198 | #Install Oh-My-Zsh 199 | sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" 200 | 201 | #Fix Catalina bug with "Insecure completion-dependent directories detected". Uncomment only when needed 202 | #compaudit | xargs chmod g-w,o-w 203 | 204 | # Install terminal colors for zsh (light theme) 205 | # Use this generator to translate BSD colors and Linux colors: https://geoff.greer.fm/lscolors/ 206 | echo -e 'export LSCOLORS="ExFxBxDxCxegedabagacad"' >> ~/.zshrc 207 | echo -e 'export LS_COLORS="di=1;34:ln=1;35:so=1;31:pi=1;33:ex=1;32:bd=34;46:cd=34;43:su=30;41:sg=30;46:tw=30;42:ow=30;43"' >> ~/.zshrc 208 | echo -e "zstyle ':completion:*:default' list-colors \${(s.:.)LS_COLORS}" >> ~/.zshrc 209 | 210 | # Replaces default theme with jreese theme (works great with light theme) 211 | sed -i -e 's/ZSH_THEME="robbyrussell"/ZSH_THEME="jreese"/g' ~/.zshrc 212 | 213 | # Uncomment en_US.UTF-8 locale for console, making them undependable from macOS locale settings 214 | sed -i -e 's/# export LANG=en_US.UTF-8/export LANG=en_US.UTF-8/g' ~/.zshrc 215 | 216 | # Disable mouse acceleration with defaults. Crucial for gaming 217 | # from macOS 14 Sonoma, there's a separate control to set mouse acceleration and speed! 🎉🎉🎉 It took only 40 years 🙃 218 | # I'm commenting out this command as a form of deprecation. I'll remove this command in the near future. 219 | # defaults write .GlobalPreferences com.apple.mouse.scaling -1 220 | 221 | # Copy SF Mono font (available only in Xcode and Terminal.app) to the system 222 | cp -R /System/Applications/Utilities/Terminal.app/Contents/Resources/Fonts/. /Library/Fonts/ 223 | 224 | # Use VSCode as a git editor, for difftool and mergetool 225 | git config --global core.editor "code --wait" 226 | git config --global merge.tool "vscode" 227 | git config --global mergetool.vscode.cmd "code --wait \$MERGED" 228 | git config --global diff.tool "vscode" 229 | git config --global difftool.vscode.cmd "code --wait --diff \$LOCAL \$REMOTE" 230 | 231 | # Remove ALL icons (except Finder) from dock 232 | echo "Removing all icons (except Finder) from the dock…" 233 | defaults write com.apple.dock persistent-apps -array 234 | 235 | # List of dock icons 236 | dockIcons=( 237 | /System/Applications/Utilities/Terminal.app 238 | /System/Applications/Mail.app 239 | /System/Applications/Messages.app 240 | /Applications/Discord.app 241 | /Applications/Signal.app 242 | /Applications/Slack.app 243 | /Applications/Safari.app 244 | /System/Applications/Music.app 245 | /Applications/Bear.app 246 | /Applications/Things3.app 247 | /System/Applications/Calendar.app 248 | /Applications/Fork.app 249 | "/Applications/Visual Studio Code.app" 250 | /Applications/Xcode.app 251 | ) 252 | 253 | # Adding icons 254 | for icon in "${dockIcons[@]}" 255 | do 256 | echo "Adding $icon to the dock…" 257 | defaults write com.apple.dock persistent-apps -array-add "tile-datafile-data_CFURLString$icon_CFURLStringType0" 258 | done 259 | 260 | echo "Setting up dock size…" 261 | defaults write com.apple.dock tilesize -int 40 262 | 263 | echo "Restarting dock…" 264 | killall Dock 265 | 266 | # List of brew packages 267 | brewPackages=( 268 | swiftlint # Linter for swift language 269 | carthage # Dependency manager for iOS apps 270 | #mint # Dependency manager that installs and runs Swift command-line tool packages 271 | gnupg # OpenPGP for signing and encrypting 272 | pinentry-mac # App to use macOS native keychain for PGP passwords 273 | pandoc # Markup to Word/Open office converter needed by Typora 274 | git-delta # Language syntax-highlighting for git show / git add -p 275 | #Unused 276 | # vapor/tap/vapor # backend framework 277 | # python # Python version 3.7, preinstalled is 2.7 278 | #Dependencies used to create a macOS VM through https://github.com/myspaghetti/macos-virtualbox 279 | #bash # newest bash version. System's default is 3 280 | #coreutils # GNU File, Shell, and Text utilities 281 | #dmg2img # Utilities for converting macOS DMG images 282 | #gzip # Popular GNU data compression program 283 | #unzip # Extraction utility for .zip compressed archives 284 | #wget # Internet file retriever 285 | ) 286 | 287 | # install brew packages 288 | brew install ${brewPackages[@]} 289 | 290 | # Setup git-delta 291 | git config --global core.pager "delta --theme='GitHub'" 292 | git config --global interactive.diffFilter "delta --color-only --theme='GitHub'" 293 | 294 | # (Use only if you installed Xcode!) As we installed homebrew before Xcode, we need to switch to Xcode Command Line Tools... 295 | sudo xcode-select -s /Applications/Xcode.app/Contents/Developer 296 | 297 | # (use only if you installed Xcode!) ...and delete the other one as described in 298 | # https://developer.apple.com/library/archive/technotes/tn2339/_index.html#//apple_ref/doc/uid/DTS40014588-CH1-HOW_CAN_I_UNINSTALL_THE_COMMAND_LINE_TOOLS_ 299 | sudo rm -rf /Library/Developer/CommandLineTools 300 | 301 | # List of mint packages 302 | #mintPackages=( 303 | # MakeAWishFoundation/SwiftyMocky # Library to autogenerate mocks 304 | #) 305 | 306 | #mint install ${mintPackages[@]} 307 | 308 | # install CocoaPods dependency manager for iOS apps 309 | sudo gem install cocoapods 310 | 311 | # install CocoaPods Keys plugin. WARNING: Problems with ARM CPU! 312 | sudo gem install cocoapods-keys 313 | 314 | # install Push Notification sender for APNS v 1.7.5 working with Catalina 315 | cd ~/Downloads/ && 316 | curl -O -L https://github.com/onmyway133/PushNotifications/releases/download/1.7.5/Push.Notifications-1.7.5-mac.dmg && 317 | cd - && 318 | hdiutil attach ~/Downloads/Push.Notifications-1.7.5-mac.dmg && 319 | cp -a /Volumes/Push\ Notifications\ 1.7.5/Push\ Notifications.app/ /Applications/Push\ Notifications.app && 320 | hdiutil unmount /Volumes/Push\ Notifications\ 1.7.5/ && 321 | rm -rf ~/Downloads/Push.Notifications-1.7.5-mac.dmg 322 | 323 | # Xcode won't ask for password with every build 324 | DevToolsSecurity -enable 325 | 326 | # Create symlinks between home folder and iCloud folders 327 | # Without this navigating in Finder between iCloud folders (like Desktop) 328 | # and Home Folders (like Downloads) only with keyboard is nearly impossible 329 | 330 | #WARNING This command uses "~" sign, so don't just copy paste it using ZSH. Use bash for this one! 331 | ln -s ~/ ~/Library/Mobile\ Documents/com~apple~CloudDocs/$(whoami)\ home\ symlink 332 | ln -s ~/Library/Mobile\ Documents/com~apple~CloudDocs/Documents ~/Documents\ symlink 333 | ln -s ~/Desktop ~/Desktop\ symlink 334 | 335 | # If you want to make a Developer folder synchronise. 336 | # WARNING: Do not use this iCloud folder for active development! Store only finished/abandoned projects, 337 | # as changing git branches with thousands of small files will break the synch. 338 | 339 | mkdir ~/Library/Mobile\ Documents/com~apple~CloudDocs/Developer 340 | ln -s ~/Library/Mobile\ Documents/com~apple~CloudDocs/Developer ~/Developer\ symlink 341 | 342 | # Make pinentry-mac your default pientry choice 343 | echo "pinentry-program $(which pinentry-mac)" >> ~/.gnupg/gpg-agent.conf 344 | 345 | #Export GPG keys (from the other mac!) 346 | #Get the keys IDs 347 | gpg --list-keys 348 | gpg --list-secret-keys 349 | #Export keys 350 | gpg --export-secret-keys --armor > ./file-sec.gpg 351 | gpg --export --armor > ./file.gpg 352 | 353 | # Import GPG keys. 354 | # WARNING: You need to replace the and with the actual paths. 355 | gpg --import 356 | gpg --allow-secret-key-import --import 357 | 358 | # Configure git 359 | 360 | # On a specific repository... 361 | git config user.email "myname@domain.com" 362 | git config user.name "My Name" 363 | git config user.signingkey 364 | git config commit.gpgsign true 365 | 366 | # … or globally 367 | git config --global commit.gpgsign true 368 | git config --global user.signingkey 369 | 370 | ## CRUCIAL TO CHECK IF YOUR MAC HAD PREVIOUS OWNERS (OR IS NOT YOURS) 371 | # To check if your Mac is enrolled to Mobile Device Management try renewing it 372 | sudo profiles renew -type enrollment 373 | # And then validate 374 | sudo profiles validate -type enrollment 375 | # By default you should not be enrolled. If you are, external organisation can manage your macOS! 376 | 377 | # Update installed apps and clear caches 378 | brew update 379 | brew upgrade 380 | brew cleanup 381 | rm -rf ~/Library/Caches/Homebrew 382 | 383 | # Visual Studio Code setup 384 | # * Disable telemetry 385 | # * Choose SF Mono as a default font 386 | # * Choose white theme and change ANSI bright blue to feel the same as in Terminal.app 387 | # For more see settings.json file 388 | cp ./vscodesettings.json ~/Library/Application\ Support/Code/User/settings.json 389 | --------------------------------------------------------------------------------