├── .gitignore ├── Applications ├── 1Password.sh ├── AdGuardSafariExtentsion.sh ├── AlDente.sh ├── AppRemovals.sh ├── BeyondCompare.sh ├── Boop.sh ├── BraveBrowser.sh ├── Composer.sh ├── Discord.sh ├── Docker.sh ├── Figma.sh ├── Firefox.sh ├── Fork.sh ├── GasMask.sh ├── Git.sh ├── GnuPG.sh ├── GoogleChrome.sh ├── GrandPerspective.sh ├── Heroic.sh ├── Homebrew.sh ├── Keka.sh ├── LinearMouse.sh ├── MAMP.sh ├── MacAppStoreCLI.sh ├── MacsFanControl.sh ├── MicrosoftOffice.sh ├── Nova.sh ├── OpenSSH.sh ├── OrbStack.sh ├── OverSight.sh ├── PHP.sh ├── Pixelmator.sh ├── Rosetta.sh ├── SequelAce.sh ├── SonarQube.sh ├── Spotify.sh ├── Steam.sh ├── Strongbox.sh ├── SyntaxHighlightQL.sh ├── Telegram.sh ├── Transmission.sh ├── Tresorit.sh ├── VLCMediaPlayer.sh ├── VSCode.sh ├── Warp.sh ├── Whisky.sh ├── XcodeCLT.sh ├── Xnapper.sh ├── eqMac.sh ├── macOSAppUpdates.sh └── wget.sh ├── FilesFolders ├── DesktopPictures.sh ├── Userfiles.sh └── Userfolders.sh ├── LICENSE ├── README.md ├── README_demo.png ├── Systemservices ├── Airdrop.sh ├── FileVault.sh ├── Firewall.sh ├── LoginWindow.sh ├── StartupChime.sh └── Timemachine.sh ├── Usersettings ├── ActivityMonitor.sh ├── ControlCentre.sh ├── Dock.sh ├── Finder.sh ├── Gitconfig.sh ├── Keyboard.sh ├── Menuclock.sh ├── Messages.sh ├── MissionControl.sh ├── Music.sh ├── Photos.sh ├── SSHkey.sh ├── Safari.sh ├── Screenshots.sh ├── Spotlight.sh ├── Terminal.sh ├── TextEdit.sh ├── Trackpad.sh └── Userhome.sh ├── config.default.sh ├── helpers.sh ├── mycommands.template.sh └── run.sh /.gitignore: -------------------------------------------------------------------------------- 1 | # General 2 | .DS_Store 3 | .AppleDouble 4 | .LSOverride 5 | 6 | # Icon must end with two \r 7 | Icon^M^M 8 | 9 | # Thumbnails 10 | ._* 11 | 12 | # Files that might appear in the root of a volume 13 | .DocumentRevisions-V100 14 | .fseventsd 15 | .Spotlight-V100 16 | .TemporaryItems 17 | .Trashes 18 | .VolumeIcon.icns 19 | .com.apple.timemachine.donotpresent 20 | 21 | # Directories potentially created on remote AFP share 22 | .AppleDB 23 | .AppleDesktop 24 | Network Trash Folder 25 | Temporary Items 26 | .apdisk 27 | 28 | # Third-party Application files and folder 29 | .nova/ 30 | *.code-workspace 31 | -------------------------------------------------------------------------------- /Applications/1Password.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | function installApp1Password(){ 4 | # --> Download & Unzip 5 | downloadFromUrl "https://downloads.1password.com/mac/1Password.zip" "1PasswordInstaller.zip" 6 | unzipFile "1PasswordInstaller.zip" 7 | # --> Launch Installer 8 | open "$HOME/Downloads/1Password Installer.app" 9 | } 10 | export -f installApp1Password 11 | 12 | # "1Password for Safari" Browser Extension 13 | function masinstallApp1PasswordSafariExtension(){ 14 | # https://apps.apple.com/ch/app/1password-for-safari/id1569813296 15 | mas install 1569813296 16 | } 17 | export -f masinstallApp1PasswordSafariExtension 18 | -------------------------------------------------------------------------------- /Applications/AdGuardSafariExtentsion.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | function masinstallAppAdGuardSafariExtension(){ 4 | # https://apps.apple.com/ch/app/adguard-for-safari/id1440147259 5 | mas install 1440147259 6 | } 7 | export -f masinstallAppAdGuardSafariExtension 8 | -------------------------------------------------------------------------------- /Applications/AlDente.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | function installAppAlDente(){ 4 | # --> Download 5 | downloadFromUrl "https://apphousekitchen.com/aldente/AlDente-Pro.dmg" "AlDente.dmg" 6 | # --> Mount & move 7 | unmountFile "AlDente.dmg" "AlDente" 8 | moveApplication "AlDente.app" 9 | } 10 | export -f installAppAlDente 11 | -------------------------------------------------------------------------------- /Applications/AppRemovals.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # -- Remove Apple's Garageband.app -- 4 | function removeAppGarageband(){ 5 | local location="/Applications/GarageBand.app" 6 | if checkIfFileExists "$location"; then 7 | rm "$location" 8 | fi 9 | } 10 | export -f removeAppGarageband 11 | 12 | # -- Remove Apple's iMovie.app -- 13 | function removeAppiMovie(){ 14 | local location="/Applications/iMovie.app" 15 | if checkIfFileExists "$location"; then 16 | rm "$location" 17 | fi 18 | } 19 | export -f removeAppiMovie 20 | -------------------------------------------------------------------------------- /Applications/BeyondCompare.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | function installAppBeyondCompare(){ 4 | # --> Find dynamic download path for the latest version and build number 5 | local downloadVersion=$(curl -s "https://www.scootersoftware.com/download.php" | grep -o -m 1 '/files/BCompareOSX-[0-9.]\+\.zip') 6 | if [ -z "$downloadVersion" ]; then 7 | showinfo "Failed to extract App version from\nhttps://www.scootersoftware.com/download.php" "error" 8 | return 1 # error 9 | else 10 | local downloadUrl="https://www.scootersoftware.com$downloadVersion" 11 | # --> Download & Unzip 12 | downloadFromUrl "$downloadUrl" "BeyondCompare.zip" 13 | unzipFile "BeyondCompare.zip" 14 | # --> Move to Applications 15 | moveApplication "Beyond Compare.app" 16 | fi 17 | } 18 | export -f installAppBeyondCompare 19 | -------------------------------------------------------------------------------- /Applications/Boop.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | function masinstallAppBoop(){ 4 | # https://apps.apple.com/ch/app/boop/id1518425043) 5 | mas install 1518425043 6 | } 7 | export -f masinstallAppBoop 8 | -------------------------------------------------------------------------------- /Applications/BraveBrowser.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | function installAppBraveBrowser(){ 4 | # --> Download 5 | downloadFromUrl "https://laptop-updates.brave.com/latest/osx" "Brave.dmg" 6 | local downloadFolder="$HOME/Downloads/" 7 | downloadFromUrl "$downloadUrl" "Brave.dmg" 8 | # --> Mount & move 9 | unmountFile "Brave.dmg" "Brave Browser" 10 | moveApplication "Brave Browser.app" 11 | fi 12 | } 13 | export -f installAppBraveBrowser 14 | -------------------------------------------------------------------------------- /Applications/Composer.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | function brewinstallAppComposer(){ 4 | # --> Installation 5 | brew install composer 6 | } 7 | export -f brewinstallAppComposer 8 | -------------------------------------------------------------------------------- /Applications/Discord.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | function installAppDiscord(){ 4 | # --> Download 5 | downloadFromUrl "https://discord.com/api/download?platform=osx" "Discord.dmg" 6 | # --> Mount & move 7 | unmountFile "Discord.dmg" "Discord" 8 | moveApplication "Discord.app" 9 | } 10 | export -f installAppDiscord 11 | -------------------------------------------------------------------------------- /Applications/Docker.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | function brewinstallAppDocker(){ 4 | # --> Installation 5 | brew install --cask --no-quarantine docker 6 | # --> Open App (hidden, to complete Installation) 7 | open -gj $HOME/Applications/Docker.app 8 | } 9 | export -f brewinstallAppDocker 10 | -------------------------------------------------------------------------------- /Applications/Figma.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | function installAppFigma(){ 4 | # --> Download 5 | downloadFromUrl "https://www.figma.com/download/desktop/mac" "Figma.dmg" 6 | # --> Mount & move 7 | unmountFile "Figma.dmg" "Figma" 8 | moveApplication "Figma.app" 9 | } 10 | export -f installAppFigma 11 | -------------------------------------------------------------------------------- /Applications/Firefox.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | function installAppFirefox(){ 4 | # --> Download 5 | downloadFromUrl "https://download.mozilla.org/?product=firefox-latest-ssl&os=osx&lang=en-US" "Firefox.dmg" 6 | # --> Mount & move 7 | unmountFile "Firefox.dmg" "Firefox" 8 | moveApplication "Firefox.app" 9 | } 10 | export -f installAppFirefox 11 | -------------------------------------------------------------------------------- /Applications/Fork.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | function installAppFork(){ 4 | # --> Fork version to use 5 | local download_link=$(curl -s "https://git-fork.com/" | sed -n 's/.*id="downloadBtn1Mac".*href="\([^"]*\)".*/\1/p') 6 | # --> Download 7 | downloadFromUrl "$download_link" "Fork.dmg" 8 | # --> Mount & move (and open) 9 | unmountFile "Fork.dmg" "Fork" 10 | moveApplication "Fork.app" #"open" -> Disabled due to Quarantine warning 11 | } 12 | export -f installAppFork 13 | -------------------------------------------------------------------------------- /Applications/GasMask.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | function installAppGasMask(){ 4 | # --> Download & Unzip 5 | downloadFromUrl "https://github.com/2ndalpha/gasmask/releases/download/0.8.6/gas_mask_0.8.6.zip" "GasMask.zip" 6 | # --> Unzip 7 | unzipFile "GasMask.zip" 8 | # --> Move & open Application 9 | moveApplication "Gas Mask.app" "open" 10 | } 11 | export -f installAppGasMask 12 | -------------------------------------------------------------------------------- /Applications/Git.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | function brewinstallAppGit(){ 4 | # --> Installation 5 | brew install git 6 | } 7 | export -f brewinstallAppGit 8 | -------------------------------------------------------------------------------- /Applications/GnuPG.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # Install GnuPG to enable PGP-signing commits. 4 | function brewinstallAppGnuPG(){ 5 | brew install gnupg 6 | } 7 | export -f brewinstallAppGnuPG 8 | -------------------------------------------------------------------------------- /Applications/GoogleChrome.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | function installAppGoogleChrome(){ 4 | # --> Download 5 | downloadFromUrl "https://dl.google.com/chrome/mac/universal/stable/GGRO/googlechrome.dmg" "GoogleChrome.dmg" 6 | # --> Mount & move 7 | unmountFile "GoogleChrome.dmg" "Google Chrome" 8 | moveApplication "Google Chrome.app" 9 | # --> Configure App 10 | configureAppGoogleChrome 11 | } 12 | export -f installAppGoogleChrome 13 | 14 | function configureAppGoogleChrome(){ 15 | # Disable the all too sensitive backswipe on trackpads 16 | defaults write com.google.Chrome AppleEnableSwipeNavigateWithScrolls -bool FALSE 17 | defaults write com.google.Chrome.canary AppleEnableSwipeNavigateWithScrolls -bool FALSE 18 | 19 | # Disable the all too sensitive backswipe on Magic Mouse 20 | defaults write com.google.Chrome AppleEnableMouseSwipeNavigateWithScrolls -bool FALSE 21 | defaults write com.google.Chrome.canary AppleEnableMouseSwipeNavigateWithScrolls -bool FALSE 22 | 23 | # Use the system-native print preview dialog 24 | defaults write com.google.Chrome DisablePrintPreview -bool TRUE 25 | defaults write com.google.Chrome.canary DisablePrintPreview -bool TRUE 26 | 27 | # Expand the print dialog by default 28 | defaults write com.google.Chrome PMPrintingExpandedStateForPrint2 -bool TRUE 29 | defaults write com.google.Chrome.canary PMPrintingExpandedStateForPrint2 -bool TRUE 30 | } 31 | export -f configureAppGoogleChrome 32 | -------------------------------------------------------------------------------- /Applications/GrandPerspective.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | function installAppGrandPerspective(){ 4 | # --> Version 5 | local version="3.4.2" 6 | # --> Download 7 | local downloadFromUrl "https://downloads.sourceforge.net/project/grandperspectiv/grandperspective/$version/GrandPerspective-3_4_2.dmg?ts=gAAAAABlBrA5VHhuRY9rcLD3hJgR2C3IQciYRJgp5UlHW-BBkHMzhcBWavFsEdHTYCFyKnHWoc_COkxXYhEn37gEWywXjkMo0w%3D%3D" "GrandPerspective.dmg" 8 | # --> Mount & copy 9 | # (Cannot use unmountFile() function due to Volume having a different name than the App) 10 | hdiutil attach "$downloadFolder/GrandPerspective.dmg" -quiet 11 | cp -R "/Volumes/GrandPerspective $version/GrandPerspective.app" "$downloadFolder" 12 | # --> Unmount & move 13 | hdiutil unmount "/Volumes/GrandPerspective $version" -force -quiet 14 | moveApplication "GrandPerspective.app" 15 | } 16 | export -f installAppGrandPerspective 17 | -------------------------------------------------------------------------------- /Applications/Heroic.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # Transmission.app 4 | function installAppHeroicGamesLauncher(){ 5 | # --> App version to use 6 | local version="2.14.1" 7 | local platform="-arm64" 8 | # --> Set Download URL 9 | if checkIfAppleSilicion; then 10 | # ...for ARM-based Apple Silicon Macs 11 | local downloadUrl="https://github.com/Heroic-Games-Launcher/HeroicGamesLauncher/releases/download/v$version/Heroic-$version-macOS-arm64.dmg" 12 | else 13 | # ...for Intel-based Macs 14 | platform="" 15 | local downloadUrl="https://github.com/Heroic-Games-Launcher/HeroicGamesLauncher/releases/download/v$version/Heroic-$version-macOS-x64.dmg" 16 | fi 17 | # --> Download 18 | downloadFromUrl "downloadUrl" "Heroic.dmg" 19 | # --> Mount & copy 20 | # (Cannot use unmountFile() function due to Volume having a different name than the App) 21 | hdiutil attach "$downloadFolder/Heroic.dmg" -quiet 22 | cp -r "/Volumes/Heroic $version$platform/Heroic.app" "$downloadFolder" 23 | # --> Unmount & move 24 | hdiutil unmount "/Volumes/Heroic $version-$platform" -force -quiet 25 | moveApplication "Heroic.app" 26 | } 27 | export -f installAppHeroicGamesLauncher 28 | -------------------------------------------------------------------------------- /Applications/Homebrew.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # Homebrew installation 4 | function installAppHomebrew(){ 5 | if ! checkIfHomebrewInstalled; then 6 | # --> Check for Xcode CLT 7 | # (pre-requisite for Homebrew) 8 | if ! checkIfXcodeInstalled; then 9 | installAppXcodeCLT 10 | fi 11 | 12 | # --> Notify 13 | notify 14 | # --> Installation 15 | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" 16 | # --> Configure Homebrew 17 | configureAppHomebrew 18 | fi 19 | } 20 | export -f installAppHomebrew 21 | 22 | # Homebrew configurations 23 | function configureAppHomebrew(){ 24 | if checkIfHomebrewInstalled; then 25 | # --> Add Homebrew to User's PATH 26 | (echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> $HOME/.zprofile 27 | # --> Reload ZSH Shell config file 28 | source $HOME/.zprofile 29 | 30 | # --> Enable Homebrew's Auto-Update (requires LaunchAgents directory) 31 | mkdir -p "$HOME/Library/LaunchAgents" 32 | brew autoupdate start --upgrade 33 | fi 34 | } 35 | export -f configureAppHomebrew 36 | -------------------------------------------------------------------------------- /Applications/Keka.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | function installAppKeka(){ 4 | # --> Download 5 | downloadFromUrl "https://d.keka.io/" "Keka.dmg" 6 | # --> Mount & move (and open) 7 | unmountFile "Keka.dmg" "Keka" 8 | moveApplication "Keka.app" #"open" -> Disabled due to Quarantine warning 9 | } 10 | export -f installAppKeka 11 | -------------------------------------------------------------------------------- /Applications/LinearMouse.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | function installAppLinearMouse(){ 4 | # --> Download 5 | downloadFromUrl "https://dl.linearmouse.org/latest/LinearMouse.dmg" "LinearMouse.dmg" 6 | # --> Mount & move 7 | unmountFile "LinearMouse.dmg" "LinearMouse" 8 | moveApplication "LinearMouse.app" 9 | } 10 | export -f installAppLinearMouse 11 | -------------------------------------------------------------------------------- /Applications/MAMP.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | function installAppMAMP(){ 4 | # --> MAMP version to use 5 | local version="6.9" 6 | # --> Set Download URL 7 | if checkIfAppleSilicion; then 8 | # ...for ARM-based Apple Silicon Macs 9 | local downloadUrl="https://downloads.mamp.info/MAMP-PRO/releases/$version/MAMP_MAMP_PRO_$version-M1-arm.pkg" 10 | else 11 | # ...for Intel-based Macs 12 | local downloadUrl="https://downloads.mamp.info/MAMP-PRO/releases/$version/MAMP_MAMP_PRO_$version-Intel-x86.pkg" 13 | fi 14 | # --> Download 15 | downloadFromUrl "$downloadUrl" "MAMP.pkg" 16 | # --> Launch Package Installer 17 | installer -pkg "$HOME/Downloads/MAMP.pkg" -target / 18 | } 19 | export -f installAppMAMP 20 | -------------------------------------------------------------------------------- /Applications/MacAppStoreCLI.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # Mac App Store Command-Line Client 4 | function brewinstallAppMacAppStoreCLI(){ 5 | # --> Installation 6 | brew install mas 7 | # --> Trigger App Store sign-in 8 | configureAppMacAppStore 9 | } 10 | export -f brewinstallAppMacAppStoreCLI 11 | 12 | # Mac App Store Sign-in (required for MAS to work) 13 | function configureAppMacAppStore(){ 14 | # --> Sign-in to App Store 15 | if [ ! $(checkIfAppStoreAuthenticated) ]; then 16 | if ! mas account > /dev/null; then 17 | # --> Open App Store.app 18 | open /System/Applications/App\ Store.app 19 | # --> Notify about sign-in to App Store 20 | notify 21 | local retries=12 # = for 60 Seconds 22 | until mas account >/dev/null || [ "$retries" = 0 ]; do 23 | local BOLD=$(tput bold) 24 | local REGULAR=$(tput sgr0) 25 | local countdown=$((retries * 5)) 26 | showinfo "Please open App Store and sign in using your Apple ID.\nSkipping this check in: ${BOLD}$countdown seconds${REGULAR}" "error" 27 | ((retries--)) 28 | sleep 5 29 | done 30 | fi 31 | fi 32 | } 33 | export -f configureAppMacAppStore 34 | -------------------------------------------------------------------------------- /Applications/MacsFanControl.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | function installAppMacsFanControl(){ 4 | # --> Download & Unzip 5 | downloadFromUrl "https://crystalidea.com/downloads/macsfancontrol.zip" "MacsFanControl.zip" 6 | # --> Unzip 7 | unzipFile "MacsFanControl.zip" 8 | # --> Move & open Application 9 | moveApplication "Macs Fan Control.app" "open" 10 | } 11 | export -f installAppMacsFanControl 12 | -------------------------------------------------------------------------------- /Applications/MicrosoftOffice.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | function installAppMicrosoftOffice(){ 4 | # --> Set Download URL 5 | # Source: https://learn.microsoft.com/en-us/deployoffice/mac/deployment-options-for-office-for-mac 6 | local downloadUrl="https://go.microsoft.com/fwlink/p/?linkid=2009112" 7 | # --> Download 8 | downloadFromUrl "$downloadUrl" "MSOfficeForMac.pkg" 9 | # --> Launch Package Installer 10 | installer -pkg "$HOME/Downloads/MSOfficeForMac.pkg" -target / 11 | } 12 | export -f installAppMicrosoftOffice 13 | -------------------------------------------------------------------------------- /Applications/Nova.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | function installAppNova(){ 4 | # --> Download & Unzip 5 | downloadFromUrl "https://download.panic.com/nova/Nova-Latest.zip" "Nova.zip" 6 | # --> Unzip 7 | unzipFile "Nova.zip" 8 | # --> Move to Applications 9 | moveApplication "Nova.app" 10 | } 11 | export -f installAppNova 12 | -------------------------------------------------------------------------------- /Applications/OpenSSH.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | function brewinstallAppOpenSSH(){ 4 | # --> Installation 5 | brew install openssh 6 | } 7 | export -f brewinstallAppOpenSSH 8 | -------------------------------------------------------------------------------- /Applications/OrbStack.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | function installAppOrbStack(){ 4 | # --> Set Download URL 5 | if checkIfAppleSilicion; then 6 | # ...for ARM-based Apple Silicon Macs 7 | local downloadUrl="https://orbstack.dev/download/beta/latest/arm64" 8 | else 9 | # ...for Intel-based Macs / Universal (Fallback) 10 | local downloadUrl="https://orbstack.dev/download/beta/latest/amd64" 11 | fi 12 | # --> Download 13 | downloadFromUrl "$downloadUrl" "OrbStack.dmg" 14 | # --> Mount & copy 15 | # (Cannot use unmountFile() function due to Volume having a different name than the App) 16 | hdiutil attach "$downloadFolder/OrbStack.dmg" -quiet 17 | cp -R /Volumes/Install\ OrbStack\ v*/OrbStack.app "$downloadFolder" 18 | # --> Unmount & move 19 | hdiutil unmount /Volumes/Install\ OrbStack\ v* -force -quiet 20 | moveApplication "OrbStack.app" 21 | } 22 | export -f installAppOrbStack 23 | 24 | function brewinstallAppOrbStack(){ 25 | # --> Installation 26 | brew install orbstack 27 | } 28 | export -f brewinstallAppOrbStack 29 | -------------------------------------------------------------------------------- /Applications/OverSight.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | function installAppOverSight(){ 4 | # --> Version to use (default: latest) 5 | local version="2.3.0" 6 | # --> Download & Unzip 7 | downloadFromUrl "https://github.com/objective-see/OverSight/releases/latest/download/OverSight_$version.zip" "OverSight.zip" 8 | # --> Unzip 9 | unzipFile "OverSight.zip" 10 | # --> Launch Installer 11 | open "$HOME/Downloads/OverSight Installer.app" 12 | } 13 | export -f installAppOverSight 14 | -------------------------------------------------------------------------------- /Applications/PHP.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | function brewinstallAppPHP(){ 4 | # --> Installation 5 | brew install php 6 | } 7 | export -f brewinstallAppPHP 8 | -------------------------------------------------------------------------------- /Applications/Pixelmator.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | function masinstallAppPixelmator(){ 4 | # https://apps.apple.com/ch/app/pixelmator-pro/id1289583905) 5 | mas install 1289583905 6 | } 7 | export -f masinstallAppPixelmator 8 | -------------------------------------------------------------------------------- /Applications/Rosetta.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | function installAppRosetta(){ 4 | /usr/sbin/softwareupdate --install-rosetta --agree-to-license > /dev/null 5 | } 6 | export -f installAppRosetta 7 | -------------------------------------------------------------------------------- /Applications/SequelAce.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | function brewinstallAppSequelAce(){ 4 | # --> Installation 5 | brew install --cask --no-quarantine sequel-ace 6 | } 7 | export -f brewinstallAppSequelAce 8 | -------------------------------------------------------------------------------- /Applications/SonarQube.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | function brewinstallAppSonarQube(){ 4 | # --> Install SonarScanner for SonarQube 5 | brew install sonar-scanner 6 | 7 | # --> Install SonarQube 8 | if ! checkIfAppleSilicion; then 9 | # ...for Intel-based Macs 10 | SQdockerImage='sonarqube' 11 | docker pull $SQdockerImage 12 | #docker run -d --name "$SQdockerImage" -e SONAR_ES_BOOTSTRAP_CHECKS_DISABLE=true -p 9000:9000 $SQdockerImage:latest 13 | else 14 | # ...for ARM-based Apple Silicon Macs 15 | SQdockerImage='sonarqube-arm' 16 | mkdir "$HOME/Downloads/$SQdockerImage" 17 | git clone https://github.com/SonarSource/docker-sonarqube "$HOME/Downloads/$SQdockerImage/" 18 | docker build -t "$SQdockerImage" "$HOME/Downloads/$SQdockerImage/docker-sonarqube/9/community" 19 | #docker run -d --name sonarqube -e SONAR_ES_BOOTSTRAP_CHECKS_DISABLE=true -p 9000:9000 $SQdockerImage:latest 20 | fi 21 | 22 | # --> Run Container 23 | docker run -d --name sonarqube -e SONAR_ES_BOOTSTRAP_CHECKS_DISABLE=true -p 9000:9000 $SQdockerImage:latest 24 | } 25 | export -f brewinstallAppSonarQube 26 | -------------------------------------------------------------------------------- /Applications/Spotify.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | function installAppSpotify(){ 4 | # --> Download & Unzip 5 | downloadFromUrl "https://download.scdn.co/SpotifyInstaller.zip" "SpotifyInstaller.zip" 6 | unzipFile "SpotifyInstaller.zip" 7 | # --> Launch Installer 8 | open "$HOME/Downloads/Install Spotify.app" 9 | } 10 | export -f installAppSpotify 11 | -------------------------------------------------------------------------------- /Applications/Steam.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | function installAppSteam(){ 4 | # --> Download 5 | downloadFromUrl "https://cdn.akamai.steamstatic.com/client/installer/steam.dmg" "Steam.dmg" 6 | # --> Mount & move (and open) 7 | unmountFile "Steam.dmg" "Steam" 8 | moveApplication "Steam.app" #"open" -> Disabled due to Quarantine warning 9 | } 10 | export -f installAppSteam 11 | -------------------------------------------------------------------------------- /Applications/Strongbox.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | function masinstallAppStrongbox(){ 4 | # https://apps.apple.com/ch/app/strongbox-password-manager/id897283731?l=en 5 | mas install 897283731 6 | } 7 | export -f masinstallAppStrongbox 8 | -------------------------------------------------------------------------------- /Applications/SyntaxHighlightQL.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | function brewinstallAppSyntaxHighlight(){ 4 | # --> Installation 5 | brew install --cask --no-quarantine syntax-highlight 6 | # --> Open App (hidden) 7 | open -gj "/Applications/Syntax Highlight.app" 8 | } 9 | export -f brewinstallAppSyntaxHighlight 10 | -------------------------------------------------------------------------------- /Applications/Telegram.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | function installAppTelegram(){ 4 | # --> Download 5 | downloadFromUrl "https://telegram.org/dl/macos" "Telegram.dmg" 6 | # --> Mount & move 7 | unmountFile "Telegram.dmg" "Telegram" 8 | moveApplication "Telegram.app" 9 | } 10 | export -f installAppTelegram 11 | -------------------------------------------------------------------------------- /Applications/Transmission.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # Transmission.app 4 | function installAppTransmission(){ 5 | # --> Download 6 | downloadFromUrl "https://github.com/transmission/transmission/releases/download/3.00/Transmission-3.00.dmg" "Transmission.dmg" 7 | # --> Mount & move 8 | unmountFile "Transmission.dmg" "Transmission" 9 | moveApplication "Transmission.app" 10 | # --> Configure App 11 | configureAppTransmission 12 | } 13 | export -f installAppTransmission 14 | 15 | # Transmission.app configurations 16 | function configureAppTransmission(){ 17 | # Use `~/Downloads` to store incomplete and complete downloads 18 | defaults write org.m0k.transmission UseIncompleteDownloadFolder -bool true 19 | defaults write org.m0k.transmission IncompleteDownloadFolder -string "${HOME}/Downloads" 20 | defaults write org.m0k.transmission DownloadLocationConstant -bool true 21 | 22 | # Don’t prompt for confirmation before downloading 23 | defaults write org.m0k.transmission DownloadAsk -bool false 24 | defaults write org.m0k.transmission MagnetOpenAsk -bool false 25 | 26 | # Don’t prompt for confirmation before removing non-downloading active transfers 27 | defaults write org.m0k.transmission CheckRemoveDownloading -bool true 28 | 29 | # Trash original torrent files 30 | defaults write org.m0k.transmission DeleteOriginalTorrent -bool true 31 | 32 | # Hide the donate message 33 | defaults write org.m0k.transmission WarningDonate -bool false 34 | # Hide the legal disclaimer 35 | defaults write org.m0k.transmission WarningLegal -bool false 36 | 37 | # Randomize port on launch 38 | defaults write org.m0k.transmission RandomPort -bool true 39 | 40 | # IP block list. 41 | defaults write org.m0k.transmission BlocklistNew -bool true 42 | defaults write org.m0k.transmission BlocklistURL -string "https://github.com/Naunter/BT_BlockLists/raw/master/bt_blocklists.gz" 43 | defaults write org.m0k.transmission BlocklistAutoUpdate -bool true 44 | } 45 | export -f configureAppTransmission 46 | -------------------------------------------------------------------------------- /Applications/Tresorit.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | function installAppTresorit(){ 4 | # --> Download 5 | downloadFromUrl "https://installer.tresorit.com/Tresorit.dmg" "Tresorit.dmg" 6 | # --> Mount & move (and open) 7 | unmountFile "Tresorit.dmg" "Tresorit" 8 | moveApplication "Tresorit.app" #"open" -> Disabled due to Quarantine warning 9 | } 10 | export -f installAppTresorit 11 | -------------------------------------------------------------------------------- /Applications/VLCMediaPlayer.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | function installAppVLC(){ 4 | # --> Find current version and build number for dynamic download URL 5 | local version=$(curl -s "http://www.videolan.org/vlc/download-macosx.html" | awk -F '[<>]' '//{getline; sub(/^[[:space:]]+/, ""); sub(/<\/span>.*/, ""); print}') 6 | if [ -z "$version" ]; then 7 | showinfo "Failed to extract App version from\nhttps://www.videolan.org/vlc/download-macosx.html" "error" 8 | return 1 # error 9 | else 10 | # --> Set Download URL 11 | if checkIfAppleSilicion; then 12 | # ...for ARM-based Apple Silicon Macs 13 | local downloadUrl="http://get.videolan.org/vlc/$version/macosx/vlc-$version-arm64.dmg" 14 | else 15 | # ...for Intel-based Macs 16 | local downloadUrl="http://get.videolan.org/vlc/$version/macosx/vlc-$version-intel64.dmg" 17 | fi 18 | # --> Download 19 | local downloadFolder="$HOME/Downloads/" 20 | downloadFromUrl "$downloadUrl" "VLC.dmg" 21 | # --> Mount & copy 22 | # (Cannot use unmountFile() function due to VLC Volume having a different name than the App) 23 | hdiutil attach "$downloadFolder/VLC.dmg" -quiet 24 | cp -r "/Volumes/VLC media player/VLC.app" "$downloadFolder" 25 | # --> Unmount & move 26 | hdiutil unmount "/Volumes/VLC media player" -force -quiet 27 | moveApplication "VLC.app" 28 | fi 29 | } 30 | export -f installAppVLC 31 | -------------------------------------------------------------------------------- /Applications/VSCode.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | function installAppVSCode(){ 4 | # --> Version to use (default: latest) 5 | local version="latest" 6 | # --> Set Download URL 7 | if checkIfAppleSilicion; then 8 | # ...for ARM-based Apple Silicon Macs 9 | local downloadUrl="https://update.code.visualstudio.com/$version/cli-darwin-arm64/stable" 10 | else 11 | # ...for Intel-based Macs / Universal (Fallback) 12 | local downloadUrl="https://update.code.visualstudio.com/$version/darwin-universal/stable" 13 | fi 14 | # --> Download & Unzip 15 | downloadFromUrl "$downloadUrl" "VSCode.zip" 16 | unzipFile "VSCode.zip" 17 | # --> Move to Applications 18 | moveApplication "Visual Studio Code.app" 19 | } 20 | export -f installAppVSCode 21 | -------------------------------------------------------------------------------- /Applications/Warp.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | function installAppWarp(){ 4 | # --> Download 5 | downloadFromUrl "https://app.warp.dev/download" "Warp.dmg" 6 | # --> Mount & move 7 | unmountFile "Warp.dmg" "Warp" 8 | moveApplication "Warp.app" 9 | } 10 | export -f installAppWarp 11 | -------------------------------------------------------------------------------- /Applications/Whisky.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | function installAppWhisky(){ 4 | # --> Download & Unzip 5 | downloadFromUrl "https://github.com/Whisky-App/Whisky/releases/latest/download/Whisky.zip" "Whisky.zip" 6 | # --> Unzip 7 | unzipFile "Whisky.zip" 8 | # --> Move & open Application 9 | moveApplication "Whisky.app" "open" 10 | } 11 | export -f installAppWhisky 12 | -------------------------------------------------------------------------------- /Applications/XcodeCLT.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | function installAppXcodeCLT(){ 4 | if ! checkIfXcodeInstalled; then 5 | # --> Notify first 6 | notify 7 | # --> Install 8 | xcode-select --install &>/dev/null 9 | 10 | # --> Wait until the XCode Command Line Tools are installed 11 | # Source: https://github.com/rockholla/macosa/blob/master/bin/macosa_xcode 12 | until checkIfXcodeInstalled; do 13 | sleep 5 14 | done 15 | fi 16 | } 17 | export -f installAppXcodeCLT 18 | -------------------------------------------------------------------------------- /Applications/Xnapper.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | function installAppXnapper(){ 4 | # --> Find dynamic download URL of current version 5 | local downloadUrl=$(curl -s "https://xnapper.com/" | grep -o 'https://xnapper.com/dmg/Xnapper-[0-9\.]\{4,\}\.dmg' | sed -n '1p') 6 | # --> Download 7 | downloadFromUrl "$downloadUrl" "Xnapper.dmg" 8 | # --> Mount & move 9 | unmountFile "Xnapper.dmg" "Xnapper" 10 | moveApplication "Xnapper.app" 11 | } 12 | export -f installAppXnapper 13 | -------------------------------------------------------------------------------- /Applications/eqMac.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | function installAppEqMac(){ 4 | # --> Download 5 | downloadFromUrl "https://github.com/bitgapp/eqMac/releases/latest/download/eqMac.dmg" "eqMac.dmg" 6 | # --> Mount & move 7 | unmountFile "eqMac.dmg" "eqMac" 8 | moveApplication "eqMac.app" 9 | } 10 | export -f installAppEqMac 11 | -------------------------------------------------------------------------------- /Applications/macOSAppUpdates.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | function masinstallAppUpdates(){ 4 | # Install pending Updates from App Store 5 | mas upgrade 6 | } 7 | export -f masinstallAppUpdates 8 | -------------------------------------------------------------------------------- /Applications/wget.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # Install `wget` with IRI support. 4 | function brewinstallAppWget(){ 5 | # --> Installation 6 | brew install wget 7 | } 8 | export -f brewinstallAppWget 9 | -------------------------------------------------------------------------------- /FilesFolders/DesktopPictures.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | function createUserFolderDesktopPictures(){ 4 | if ! checkIfFileExists "$HOME/Pictures/Desktop Pictures"; then 5 | mkdir "$HOME/Pictures/Desktop Pictures" 6 | fi 7 | } 8 | export -f createUserFolderDesktopPictures 9 | 10 | # «Fuji» from dynamicwallpaper.club 11 | function downloadWallpaperFuji(){ 12 | # --> Download 13 | downloadFromUrl "https://cdn.dynamicwallpaper.club/wallpapers/gpf7f97jk3b/Fuji.heic" "Fuji.heic" 14 | # --> Move 15 | mv "$HOME/Downloads/Fuji.heic" "$HOME/Pictures/Desktop Pictures/" 16 | } 17 | export -f downloadWallpaperFuji 18 | 19 | # «Exodus» from dynamicwallpaper.club 20 | function downloadWallpaperExodus(){ 21 | # --> Download 22 | downloadFromUrl "https://cdn.dynamicwallpaper.club/wallpapers/1fwttqzokh6/Exodus%20by%20dpcdpc11.heic" "Exodus.heic" 23 | # --> Move 24 | mv "$HOME/Downloads/Exodus.heic" "$HOME/Pictures/Desktop Pictures/" 25 | } 26 | export -f downloadWallpaperExodus 27 | 28 | # «ISS» from dynwalls.com 29 | function downloadWallpaperISS(){ 30 | # --> Download 31 | downloadFromUrl "https://dynwalls.com/wallpapers/ISS.heic" "ISS.heic" 32 | # --> Move 33 | mv "$HOME/Downloads/ISS.heic" "$HOME/Pictures/Desktop Pictures/" 34 | } 35 | export -f downloadWallpaperISS 36 | -------------------------------------------------------------------------------- /FilesFolders/Userfiles.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # -- Userhome files -- 4 | # --> Create .zprofile ZSH Shell configuration file 5 | function createUserFileZprofile(){ 6 | local zprofilePath="$HOME/.zprofile" 7 | if ! checkIfFileExists $zprofilePath; then 8 | touch $zprofilePath 9 | fi 10 | } 11 | export -f createUserFileZprofile 12 | -------------------------------------------------------------------------------- /FilesFolders/Userfolders.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # -- Userhome folders -- 4 | # --> User-only Applications 5 | function createUserFolderApplications(){ 6 | if ! checkIfFileExists "$HOME/Applications"; then 7 | mkdir "$HOME/Applications" 8 | fi 9 | } 10 | export -f createUserFolderApplications 11 | 12 | # --> User-only (Web)Sites 13 | function createUserFolderSites(){ 14 | if ! checkIfFileExists "$HOME/Sites"; then 15 | mkdir "$HOME/Sites" 16 | fi 17 | } 18 | export -f createUserFolderSites 19 | 20 | # --> User-only Games 21 | function createUserFolderGames(){ 22 | if ! checkIfFileExists "$HOME/Games"; then 23 | mkdir "$HOME/Games" 24 | fi 25 | 26 | # --> Download Games folder icon 27 | if [ "$useCustomGamesFolderIcon" = true ]; then 28 | downloadFromUrl "$useCustomGamesFolderIconURL" "icon.png" 29 | mv "$HOME/Downloads/icon.png" "$HOME/Games/foldericon.png" 30 | fi 31 | } 32 | export -f createUserFolderGames 33 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 github.com/Swiss-Mac-User 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Automate your macOS setup 2 | === 3 | 4 | **Welcome to the macOS Scripted Setup.
This project helps Mac users quickly and easily set up a new computer or useraccount by automatically configuring a range of system settings and installing commonly used applications.** 5 | 6 | > [!TIP] 7 | > The scripted setup was tested on Intel-based Macs & Apple Silicon Macs 8 | > On macOS 12 Monterey up to macOS 14 Sonoma 9 | 10 | 11 | ## What is this? 12 | 13 | The macOS Scripted Setup is **perfect for users who want to save time and avoid the hassle of manually changing settings and installing apps**. The whole project, but particularly the configuration file, is **portable** - so you can keep them on a USB-stick for the next Mac setup. Give it a try and streamline your new Mac setup process! 14 | 15 | ![Screenshot of macOS Scripted Setup in action](/README_demo.png?raw=true) 16 | 17 | The script is easy to use and can be run directly from the Terminal application, as a regular user or admin user. It automatically performs a series of commands to change default macOS settings and download applications. It's designed to be widely backward and forward compatible with various macOS versions. 18 | 19 | **All settings can be configured.** Some features include enabling the firewall, setting better security features, customising the Finder, Dock, and Mission Control for better productivity; and many more. Additionally, the script installs applications such as browsers, media players, productivity apps, and web development tools. 20 | 21 | ### What is being done exactly? 22 | 23 |
24 | See what features, settings, and applications can be changed / installed 25 | 26 | ### The script can change the following settings: 27 | 28 | * FileVault, macOS Firewall, Mission Control, Control Centre, Finder, Dock, git, SSH Key, adds Userhome folders, Menu bar clock, Fast User Switching, and [more](https://github.com/Swiss-Mac-User/macOS-scripted-setup/tree/installer/Usersettings). 29 | 30 | ### …and is capable of installing these Apps: 31 | 32 | Some Apps are downloaded from the official websites, other are added through Homebrew or its Mac App Store CLI extension. 33 | 34 | * 1Password, AlDente, Beyond Compare, Boop, Brave, Composer, Discord, Docker, eqMac, Fig, Firefox, Fork, GasMask, Git, Google Chrome, Homebrew, Keka, LinearMouse, MAMP, Nova, Pixelmator Pro, Quick Look plugins, Rosetta 2, Safari extensions, Sequel Ace, SonarQube, Spotify, Steam, Strongbox, Telegram, Transmission, Tresorit, Warp, Xcode Command Line Tools, Xnapper, and [more](https://github.com/Swiss-Mac-User/macOS-scripted-setup/tree/installer/Applications). 35 |
36 | 37 | 38 | ## How to use 39 | 40 | ### 📥 Download macOS Scripted Setup 41 | 42 | Automatic download with this command in the `Terminal.app` from Applications » Utilities: 43 | 44 | ```bash 45 | curl -SL "https://github.com/Swiss-Mac-User/macOS-scripted-setup/archive/refs/heads/installer.zip" | tar xz -C "$HOME/Downloads" && open "$HOME/Downloads/macOS-scripted-setup-installer" 46 | ``` 47 | 48 | → Alternatively you can manually download & extract the latest «Source code (zip)» [from Releases](/../../releases) to your `~/Downloads/` folder. 49 | 50 | ### ⚙️ Configure your preferences 51 | 52 | 1. Duplicate the file `config.default.sh` as `config.sh` 53 | 54 | 2. Open `config.sh` in a Text editor (e.g. `TextEdit.app`) 55 | 56 | 3. …and change all settings to your personal preferences, using `true`/`false`. 57 | 58 | > [!WARNING] 59 | > If no `config.sh`-file is present, the setup will use the default configs from `config.default.sh`! 60 | 61 | #### Advanced settings 62 |
63 | Configuring custom bash commands to run 64 | 65 | If you want to run additional bash commands as part of the setup, you can duplicate the template-file `mycommands.template.sh` as `mycommands.sh`, and populate it with any commands. These custom commands will be executed LAST in the whole setup (see the `run.sh` file). 66 | 67 |
68 | 69 | 70 | ### 🚀 Start the scripted Setup 71 | 72 | Maybe now is the time to [grab a coffee ☕️](https://bmc.link/swissmacuser/)… 73 | 74 | 1. Open the «Terminal.app» from Applications » Utilities 75 | 76 | 2. Paste the following command to the Terminal.app: 77 | 78 | ```bash 79 | cd ~/Downloads/macOS-scripted-setup-installer/ && chmod +x ./run.sh && ./run.sh 80 | ``` 81 | 82 | 3. Now start the setup by pressing `Return` & watch the magic happen… 83 | 84 | > [!TIP] 85 | > **Occasionally you have to interact** when instructions show up, such as to sign-in on the Mac App Store. 86 | 87 | #### ✨ That's it - happy installation! :) 88 | 89 | 90 | ## Requests for changes 91 | 92 | ### Issues and feature requests 93 | Report an [Issue](/../../issues) or start a [new Discussion](/../../discussions) for feedback or help. 94 | 95 | ### Contributions 96 | Feel free to [fork this project](/../../fork) and add Pull Requests for any suggested changes or additions! 97 | 98 | 99 | --- 100 | 101 |

102 | Support this project with a Coffee. 103 |

104 | 105 | ### Inspiration and Kudos 106 | 107 | A **BIG «THANK YOU»** to these inspiring and helfpful sources! 🫶 Make sure to check them out and leave a kudos. 108 | 109 | * Yann Bertrand's awesome work with «[macOS-defaults](https://github.com/yannbertrand/macos-defaults)» 110 | * Patrick Force's approach with «[macOSa](https://github.com/rockholla/macosa)» (which was a bit too complex for my use case…) 111 | * Ryan Pavlick's helpful «[add_to_dock](https://github.com/ryanpavlick/add_to_dock)» bash scripts 112 | * Mathias Bynens's epic «[dotfiles](https://github.com/mathiasbynens/dotfiles)» (particularly its [.macos](https://github.com/mathiasbynens/dotfiles/blob/main/.macos))! 113 | * Big KUDOS to «[Homebrew](https://github.com/Homebrew/install)» and the «[Mac App Store command line interface](https://github.com/mas-cli/mas)»! 👏 114 | * MacRumors «[Dock to Show Running Apps Only](https://www.macrumors.com/how-to/macos-dock-show-active-apps/)», Ask Different «[identify if Filevault is enabled](https://apple.stackexchange.com/q/70969/86244)» and «[Check if OS X user is Administrator](https://apple.stackexchange.com/a/179531/86244)» 115 | -------------------------------------------------------------------------------- /README_demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Swiss-Mac-User/macOS-scripted-setup/bb09965d90ce0bfdb57256800b954aeabe9e6897/README_demo.png -------------------------------------------------------------------------------- /Systemservices/Airdrop.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # -- AirDrop -- 4 | # --> Enable AirDrop over Ethernet and on unsupported Macs running Lion 5 | function enableAirDropOnEthernet(){ 6 | defaults write com.apple.NetworkBrowser "BrowseAllInterfaces" -bool TRUE 7 | } 8 | export -f enableAirDropOnEthernet 9 | -------------------------------------------------------------------------------- /Systemservices/FileVault.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # -- FileVault2 -- 4 | # --> Check if FileVault is active 5 | # Source: https://apple.stackexchange.com/q/70969/86244 6 | function checkIfFileVaultOn(){ 7 | if [ "$(fdesetup isactive)" = "true" ]; then 8 | return 0 # true (is active) 9 | else 10 | return 1 # false (not enabled) 11 | fi 12 | } 13 | export -f checkIfFileVaultOn 14 | 15 | # --> Enable disk encryption of the macOS System Drive 16 | function enableFileVault(){ 17 | # Requires Admin privileges 18 | if checkIfUserIsAdmin; then 19 | if ! checkIfFileVaultOn; then 20 | # --> Notify first 21 | notify 22 | sudo fdesetup enable $(id -un) 23 | else 24 | # fdesetup status 25 | showinfo "FileVault is already enabled." "notice" 26 | fi 27 | else 28 | showinfo "'enableFileVault' requires root privileges. Run with an admin user, or using sudo." "error" 29 | fi 30 | } 31 | export -f enableFileVault 32 | -------------------------------------------------------------------------------- /Systemservices/Firewall.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # -- Built-in Firewall (com.apple.alf.plist) -- 4 | # --> Enable Stealth mode 5 | function activateFirewallStealthmode(){ 6 | # Requires Admin privileges 7 | if checkIfUserIsAdmin; then 8 | # --> Notify first 9 | notify 10 | sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setstealthmode on 11 | else 12 | echo "'activateFirewallStealthmode' requires system administrator or root privileges. Run with an admin user, or using sudo." 13 | fi 14 | } 15 | export -f activateFirewallStealthmode 16 | 17 | # --> Enable built-in Firewall 18 | function enableFirewall(){ 19 | # Requires Admin privileges 20 | if checkIfUserIsAdmin; then 21 | # --> Notify first 22 | notify 23 | sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate on 24 | else 25 | echo "'enableFirewall' requires system administrator or root privileges. Run with an admin user, or using sudo." 26 | fi 27 | } 28 | export -f enableFirewall 29 | -------------------------------------------------------------------------------- /Systemservices/LoginWindow.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # -- User Login Window -- 4 | # Hide Shutdown Button on Login Window 5 | function disableShutdownOnLogin(){ 6 | defaults write com.apple.loginwindow "ShutDownDisabled" -bool TRUE 7 | } 8 | export -f disableShutdownOnLogin 9 | 10 | # Remove Restart Button From Login Window: 11 | function disableRestartOnLogin(){ 12 | defaults write com.apple.loginwindow "RestartDisabled" -bool TRUE 13 | } 14 | export -f disableRestartOnLogin 15 | 16 | # -- Screensaver -- 17 | # Require password immediately after sleep or screen saver begins 18 | function enableUserpasswordOnScreensaver(){ 19 | defaults write com.apple.screensaver "askForPassword" -int 1 20 | defaults write com.apple.screensaver "askForPasswordDelay" -int 0 21 | } 22 | export -f enableUserpasswordOnScreensaver 23 | -------------------------------------------------------------------------------- /Systemservices/StartupChime.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # -- Play sound on startup -- 4 | # --> Enable playing the mesmerising Mac Startup Sound 5 | # Source: https://appleinsider.com/articles/20/02/22/how-to-turn-your-mac-startup-chime-back-on 6 | function enableStartupChime(){ 7 | # Requires Admin privileges 8 | if checkIfUserIsAdmin; then 9 | # --> Notify first 10 | notify 11 | sudo nvram StartupMute="%00" 12 | else 13 | echo "'enableStartupChime' requires system administrator or root privileges. Run with an admin user, or using sudo." 14 | fi 15 | } 16 | export -f enableStartupChime 17 | -------------------------------------------------------------------------------- /Systemservices/Timemachine.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # -- Time Machine settings -- 4 | # --> Prevent Time Machine asking to use new Disks as backup volume 5 | function muteTimeMachine(){ 6 | defaults write com.apple.TimeMachine "DoNotOfferNewDisksForBackup" -bool TRUE 7 | } 8 | export -f muteTimeMachine 9 | 10 | # --> Speed-up Time Machine backups 11 | function speedupTimeMachine(){ 12 | # Requires Admin privileges 13 | if checkIfUserIsAdmin; then 14 | # --> Notify first 15 | notify 16 | sudo sysctl debug.lowpri_throttle_enabled=0 17 | else 18 | echo "'speedupTimeMachine' requires system administrator privileges. Run with an admin user, or using sudo." 19 | fi 20 | } 21 | export -f speedupTimeMachine 22 | -------------------------------------------------------------------------------- /Usersettings/ActivityMonitor.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # -- Activity Monitor (Utilities App) -- 4 | # --> Change processes list view 5 | function setActivityMonitorProcesslist(){ 6 | # Show all Processes in Activity Monitor lists 7 | defaults write com.apple.ActivityMonitor "ShowCategory" -int 0 8 | } 9 | export -f setActivityMonitorProcesslist 10 | -------------------------------------------------------------------------------- /Usersettings/ControlCentre.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # -- Control Centre -- 4 | # --> Show Fast User Switching Icon 5 | function showFastUserSwitching(){ 6 | # Show Fast User Switcher in Menu Bar (use -int 9 = in CC) 7 | defaults write com.apple.controlcenter "UserSwitcher" -int 6 8 | defaults write com.apple.controlcenter "NSStatusItem Visible UserSwitcher" -int 1 9 | } 10 | export -f showFastUserSwitching 11 | 12 | # --> Show % for Battery 13 | function showBatteryPercentage(){ 14 | # Show the Battery Icon in Menu Bar 15 | defaults write com.apple.controlcenter "NSStatusItem Visible Battery" -int 1 16 | # Show the Battery % Percentage in Menu Bar 17 | defaults write com.apple.controlcenter "BatteryShowPercentage" -bool TRUE 18 | } 19 | export -f showBatteryPercentage 20 | -------------------------------------------------------------------------------- /Usersettings/Dock.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # -- Dock settings -- 4 | # --> Auto-hide the Dock 5 | function autohideDock(){ 6 | defaults write com.apple.dock "autohide" -bool TRUE 7 | } 8 | export -f autohideDock 9 | 10 | # --> Faster Dock show/hide 11 | function speedupDock(){ 12 | defaults write com.apple.dock "mineffect" -string "suck" 13 | defaults write com.apple.dock "autohide-delay" -float 0 14 | defaults write com.apple.dock "autohide-time-modifier" -float 0.8 15 | } 16 | export -f speedupDock 17 | 18 | # --> Hide recent Applications 19 | function noRecentAppsInDock(){ 20 | defaults write com.apple.dock "show-recents" -bool FALSE 21 | } 22 | export -f noRecentAppsInDock 23 | 24 | # --> Dim hidden Apps 25 | function dimHiddenAppsInDock(){ 26 | defaults write com.apple.dock "showhidden" -bool TRUE 27 | } 28 | export -f dimHiddenAppsInDock 29 | 30 | # --> Show indicator for running Apps 31 | function indicateRunningAppsInDock(){ 32 | if checkIfNotEmpty "$1" && "$1" == FALSE; then 33 | local value=FALSE 34 | else 35 | local value=TRUE 36 | fi 37 | defaults write com.apple.dock "show-process-indicators" -bool "$value" 38 | } 39 | export -f indicateRunningAppsInDock 40 | 41 | # --> Show only running Apps in Dock 42 | # Source: https://www.macrumors.com/how-to/macos-dock-show-active-apps/ 43 | function showOnlyRunningAppsInDock(){ 44 | defaults write com.apple.dock "static-only" -bool TRUE 45 | 46 | # Disable indicators for running Apps (not needed for dynamic Dock) 47 | indicateRunningAppsInDock FALSE 48 | } 49 | export -f showOnlyRunningAppsInDock 50 | 51 | # Add an Application to the macOS Dock 52 | # - usage: addAppToDock "[Application Name]" 53 | # - example: addAppToDock "Terminal" 54 | # Source: https://github.com/rpavlick/add_to_dock 55 | function addAppToDock() { 56 | local app_name="$1" 57 | local launchservices_path="/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister" 58 | local app_path=$($launchservices_path -dump | grep -o "/.*$app_name.app" | grep -v -E "Backups|Caches|TimeMachine|Temporary|/Volumes/$app_name" | uniq | sort | head -n1) 59 | if open -Ra "$app_path"; then 60 | defaults write com.apple.dock persistent-apps -array-add "tile-datafile-data_CFURLString$app_path_CFURLStringType0" 61 | else 62 | showinfo "Application not found: $1\n$app_path" "error" 63 | fi 64 | } 65 | export -f addAppToDock 66 | 67 | # Add an empty space to the macOS Dock 68 | # Source: https://github.com/rpavlick/add_to_dock 69 | function addSpacerToDock() { 70 | defaults write com.apple.dock persistent-apps -array-add '{"tile-type"="small-spacer-tile";}' 71 | } 72 | export -f addSpacerToDock 73 | 74 | # Remove all persistent App Icons from the macOS Dock 75 | # Source: https://github.com/rpavlick/add_to_dock 76 | function clearDock() { 77 | defaults write com.apple.dock persistent-apps -array 78 | } 79 | export -f clearDock 80 | 81 | # Reset the macOS Dock to Apple's default settings 82 | function resetDock() { 83 | defaults write com.apple.dock; killall Dock 84 | } 85 | export -f resetDock 86 | 87 | # --> Restart the Dock process 88 | function restartDock(){ 89 | killall Dock 90 | } 91 | export -f restartDock 92 | -------------------------------------------------------------------------------- /Usersettings/Finder.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # Apps, disable App Nap for all apps 4 | function disableAppNap(){ 5 | defaults write NSGlobalDomain "NSAppSleepDisabled" -bool TRUE 6 | } 7 | export -f disableAppNap 8 | 9 | # File save, expand save panel by default 10 | function expandAllSavePanels(){ 11 | defaults write NSGlobalDomain "NSNavPanelExpandedStateForSaveMode" -bool TRUE 12 | defaults write NSGlobalDomain "NSNavPanelExpandedStateForSaveMode2" -bool TRUE 13 | } 14 | export -f expandAllSavePanels 15 | 16 | # Print, expand print panel by default 17 | function expandAllPrintPanels(){ 18 | defaults write NSGlobalDomain "PMPrintingExpandedStateForPrint" -bool TRUE 19 | defaults write NSGlobalDomain "PMPrintingExpandedStateForPrint2" -bool TRUE 20 | } 21 | export -f expandAllPrintPanels 22 | 23 | # File save, save to disk by default rather than to iCloud 24 | function saveToDiskInsteadOfiCloud(){ 25 | defaults write NSGlobalDomain "NSDocumentSaveNewDocumentsToCloud" -bool FALSE 26 | } 27 | export -f saveToDiskInsteadOfiCloud 28 | 29 | # Finder, show all filename extensions 30 | function showAllFileExtensions(){ 31 | defaults write NSGlobalDomain "AppleShowAllExtensions" -bool TRUE 32 | } 33 | export -f showAllFileExtensions 34 | 35 | # Interface, action on double-clicking window 36 | # Interface, miniaturise on double-click 37 | function minimizeWindowsOnDoubleclick(){ 38 | defaults write NSGlobalDomain "AppleActionOnDoubleClick" -string "Minimize" 39 | defaults write NSGlobalDomain "AppleMiniaturizeOnDoubleClick" -bool TRUE 40 | } 41 | export -f minimizeWindowsOnDoubleclick 42 | 43 | # Interface, always show scrollbars 44 | function alwaysShowScrollbars(){ 45 | # Supported values: Automatic | Always | WhenScrolling 46 | defaults write NSGlobalDomain "AppleShowScrollBars" -string "WhenScrolling" 47 | } 48 | export -f alwaysShowScrollbars 49 | 50 | # Interface, close always confirms changes 51 | function alwaysConfirmClose(){ 52 | defaults write NSGlobalDomain "NSCloseAlwaysConfirmsChanges" -bool TRUE 53 | } 54 | export -f alwaysConfirmClose 55 | 56 | # Interface, disable ‘natural’ scrolling 57 | function disableNaturalScrolling(){ 58 | defaults write NSGlobalDomain "com.apple.swipescrolldirection" -bool FALSE 59 | } 60 | export -f disableNaturalScrolling 61 | 62 | # Interface: allow dragging windows anywhere using Command+Control+Click 63 | function enableFullWindowDragzone(){ 64 | defaults write NSGlobalDomain "NSWindowShouldDragOnGesture" -bool TRUE 65 | } 66 | export -f enableFullWindowDragzone 67 | 68 | # Interface, disable menu bar transparency 69 | function disableTransparencyAndTinting(){ 70 | defaults write NSGlobalDomain "AppleEnableMenuBarTransparency" -bool FALSE 71 | defaults write NSGlobalDomain "AppleReduceDesktopTinting" -bool TRUE 72 | } 73 | export -f disableTransparencyAndTinting 74 | 75 | # Contact names 76 | function disableContactstNicknames(){ 77 | defaults write NSGlobalDomain "NSPersonNameDefaultShouldPreferNicknamesPreference" -bool FALSE 78 | } 79 | export -f disableContactstNicknames 80 | 81 | # Enable Fast User Switching 82 | function enableFastUserSwitching(){ 83 | defaults write NSGlobalDomain "userMenuExtraStyle" -int 2 84 | } 85 | export -f enableFastUserSwitching 86 | 87 | # Interface, quit always saves windows 88 | function alwaysSaveWindowstateOnQuit(){ 89 | defaults write NSGlobalDomain "NSQuitAlwaysKeepsWindows" -bool TRUE 90 | } 91 | export -f alwaysSaveWindowstateOnQuit 92 | 93 | # Interface, set sidebar icon size to small (medium = 2) 94 | function useSmallIconsInSidebar(){ 95 | defaults write NSGlobalDomain "NSTableViewDefaultSizeMode" -int 1 96 | } 97 | export -f useSmallIconsInSidebar 98 | 99 | # Disable creation of Metadata Files on Network Volumes (avoids creation of .DS_Store and AppleDouble ._ files.) 100 | function disableMetadataFilesOnNetworkshares(){ 101 | defaults write com.apple.desktopservices "DSDontWriteNetworkStores" -bool TRUE 102 | } 103 | export -f disableMetadataFilesOnNetworkshares 104 | 105 | # Disable creation of Metadata Files on USB Volumes (avoids creation of .DS_Store and AppleDouble ._ files.) 106 | function disableMetadataFilesOnExternalDrives(){ 107 | defaults write com.apple.desktopservices "DSDontWriteUSBStores" -bool TRUE 108 | } 109 | export -f disableMetadataFilesOnExternalDrives 110 | 111 | # Finder: show status bar, and side bar, but hide path bar 112 | function showStatusAndPathBars(){ 113 | defaults write com.apple.finder "ShowStatusBar" -bool TRUE 114 | defaults write com.apple.finder "ShowSidebar" -bool TRUE 115 | defaults write com.apple.finder "ShowPathbar" -bool FALSE 116 | } 117 | export -f showStatusAndPathBars 118 | 119 | # When performing a search, search the current folder by default 120 | # (the default 'This Mac' is "SCev") 121 | function defaultSearchCurrentFolder(){ 122 | defaults write com.apple.finder "FXDefaultSearchScope" -string "SCcf" 123 | } 124 | export -f defaultSearchCurrentFolder 125 | 126 | # Set User Home as the default location for new Finder windows 127 | # (for other paths, use `PfLo` and `file:///full/path/here/`) 128 | function defaultNewWindowLocation(){ 129 | defaults write com.apple.finder "NewWindowTarget" -string "PfHm" 130 | defaults write com.apple.finder "NewWindowTargetPath" -string "file://${HOME}/" 131 | } 132 | export -f defaultNewWindowLocation 133 | 134 | # Show icons for hard drives, servers, and removable media on the desktop 135 | function showVolumeIconsOnDesktop(){ 136 | defaults write com.apple.finder "ShowHardDrivesOnDesktop" -bool TRUE 137 | defaults write com.apple.finder "ShowExternalHardDrivesOnDesktop" -bool TRUE 138 | defaults write com.apple.finder "ShowMountedServersOnDesktop" -bool TRUE 139 | defaults write com.apple.finder "ShowRemovableMediaOnDesktop" -bool TRUE 140 | } 141 | export -f showVolumeIconsOnDesktop 142 | 143 | # Enable snap-to-grid for icons on the desktop and in other icon views 144 | function enableSnapToGrid(){ 145 | /usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:arrangeBy grid" $HOME/Library/Preferences/com.apple.finder.plist 146 | /usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:arrangeBy grid" $HOME/Library/Preferences/com.apple.finder.plist 147 | /usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:arrangeBy grid" $HOME/Library/Preferences/com.apple.finder.plist 148 | } 149 | export -f enableSnapToGrid 150 | 151 | # Disable the warning before emptying the Trash 152 | function disableEmptyTrashWarning(){ 153 | defaults write com.apple.finder "WarnOnEmptyTrash" -bool FALSE 154 | } 155 | export -f disableEmptyTrashWarning 156 | 157 | # Automatically remove items from the Trash after 30 days 158 | function enableTrashAutoremove30days(){ 159 | defaults write com.apple.finder "FXRemoveOldTrashItems" -bool TRUE 160 | } 161 | export -f enableTrashAutoremove30days 162 | 163 | # Add Folder settings (.DS_Store files) 164 | function updateApplicationsFolderListColumns(){ 165 | if ! checkIfFileExists "$HOME/Applications/.DS_Store"; then 166 | touch "$HOME/Applications/.DS_Store" 167 | fi 168 | echo "^@^@^@^ABud1^@^@^X^@^@^@^H^@^@^@^X^@^@^@^P^K^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^H^@^@^@^H^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^$" > "$HOME/Applications/.DS_Store" 169 | } 170 | export -f updateApplicationsFolderListColumns 171 | 172 | function restartFinder(){ 173 | killall Finder 174 | } 175 | export -f restartFinder 176 | -------------------------------------------------------------------------------- /Usersettings/Gitconfig.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # Set Global Git settings 4 | function setGitconfigs(){ 5 | # Git Username 6 | if checkIfNotEmpty "$gitUsername"; then 7 | git config --global user.name $gitUsername 8 | fi 9 | 10 | # Git User Email 11 | if checkIfNotEmpty "$gitUseremail"; then 12 | git config --global user.email $gitUseremail 13 | fi 14 | 15 | # Enable Git password caching 16 | git config --global credential.helper osxkeychain 17 | 18 | # Make `git pull` only in fast-forward mode 19 | git config --global pull.ff only 20 | 21 | setGitignore 22 | } 23 | export -f setGitconfigs 24 | 25 | # Set Global Gitignore list 26 | function setGitignore(){ 27 | # Add global ignore list 28 | # --> Download 29 | downloadFromUrl "https://raw.githubusercontent.com/github/gitignore/master/Global/macOS.gitignore" "gitignore.txt" 30 | # --> Move to $HOME and configure in git 31 | mv "$HOME/Downloads/gitignore.txt" "$HOME/.gitignore" 32 | git config --global core.excludesfile $HOME/.gitignore 33 | 34 | # Extend global ignore list 35 | echo "" >> $HOME/.gitignore 36 | echo "# Third-party Application files and folder" >> $HOME/.gitignore 37 | echo ".nova/" >> $HOME/.gitignore 38 | } 39 | export -f setGitignore 40 | -------------------------------------------------------------------------------- /Usersettings/Keyboard.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # Keyboard fn 🌐 key shows Emoji & Symbols popup. Supported values: 4 | # --> 0 = No function / do nothing (default) 5 | # --> 1 = Change keyboard input source 6 | # --> 2 = Show "Emoji & Symbols" 7 | # --> 3 = Start Dictation (press 2x) 8 | function useFnKeyFor(){ 9 | local changeMode=false 10 | local configFnKeyFunction=$1 11 | case "$configFnKeyFunction" in 12 | off) changeMode=0;; 13 | language) changeMode=1;; 14 | emoji) changeMode=2;; 15 | dictation) changeMode=3;; 16 | *) changeMode=false;; 17 | esac 18 | 19 | if [ "$changeMode" != false ]; then 20 | defaults write com.apple.HIToolbox "AppleFnUsageType" -int $changeMode 21 | fi 22 | } 23 | export -f useFnKeyFor 24 | -------------------------------------------------------------------------------- /Usersettings/Menuclock.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # Menuclock settings 4 | # - FlashDateSeparators = true/false 5 | # - IsAnalog = true/false 6 | # - ShowAMPM = true/false 7 | # - Show24Hour = true/false 8 | # - ShowDate = true/false 9 | # - ShowDayOfWeek = true/false 10 | # - ShowSeconds = true/false 11 | function setReadableMenuclock(){ 12 | defaults write com.apple.menuextra.clock "FlashDateSeparators" -bool FALSE 13 | defaults write com.apple.menuextra.clock "IsAnalog" -bool FALSE 14 | defaults write com.apple.menuextra.clock "ShowAMPM" -bool FALSE 15 | defaults write com.apple.menuextra.clock "Show24Hour" -bool TRUE 16 | defaults write com.apple.menuextra.clock "ShowDate" -bool TRUE 17 | defaults write com.apple.menuextra.clock "ShowDayOfWeek" -bool TRUE 18 | defaults write com.apple.menuextra.clock "ShowSeconds" -bool TRUE 19 | } 20 | export -f setReadableMenuclock 21 | -------------------------------------------------------------------------------- /Usersettings/Messages.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # Show the subject field in Messages (subjects are sent in bold format) 4 | # Source: https://gist.github.com/getaaron/a9dc64b6ea2fa8299af6b7077f4386ae 5 | function enableMessagesSubjectField(){ 6 | defaults write com.apple.MobileSMS "MMSShowSubject" -bool TRUE 7 | } 8 | export -f enableMessagesSubjectField 9 | -------------------------------------------------------------------------------- /Usersettings/MissionControl.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # -- Mission Control -- 4 | # --> Multiple Displays use separate Spaces 5 | function useMissionControlSpacePerDisplay(){ 6 | # Each Display uses an independent Space 7 | defaults write com.apple.spaces "spans-displays" -bool FALSE 8 | } 9 | export -f useMissionControlSpacePerDisplay 10 | 11 | # --> In Mission Control, open windows are grouped by Application 12 | function groupMissionControlByApplication(){ 13 | # Mission Control groups open windows by Application 14 | defaults write com.apple.dock "expose-group-apps" -bool TRUE 15 | } 16 | export -f groupMissionControlByApplication 17 | 18 | # --> Select Space with open Application windows 19 | function switchMissionControlSpacesByApplication(){ 20 | # When selecting Application, switch to Space with its open windows 21 | defaults write com.apple.dock "AppleSpacesSwitchOnActivate" -bool TRUE 22 | } 23 | export -f switchMissionControlSpacesByApplication 24 | 25 | # --> Define Hot Corners 26 | function setMissionControlHotCorners(){ 27 | # -- Mission Control (Hot corners) -- 28 | # Possible values: 29 | # 0: not assigned 30 | # 2: Mission Control 31 | # 3: Show application windows 32 | # 4: Desktop 33 | # 5: Start screen saver 34 | # 6: Disable screen saver 35 | # 7: Dashboard 36 | # 10: Put display to sleep 37 | # 11: Launchpad 38 | # 12: Notification Center 39 | # 13: Lock Screen 40 | # --> Top left screen corner → Do nothing 41 | defaults write com.apple.dock "wvous-tl-corner" -int 0 42 | defaults write com.apple.dock "wvous-tl-modifier" -int 0 43 | # --> Top right screen corner → Mission Control 44 | defaults write com.apple.dock "wvous-tr-corner" -int 2 45 | defaults write com.apple.dock "wvous-tr-modifier" -int 0 46 | # --> Bottom left screen corner → Start screen saver 47 | defaults write com.apple.dock "wvous-bl-corner" -int 13 48 | defaults write com.apple.dock "wvous-bl-modifier" -int 0 49 | # --> Bottom right screen corner → Desktop 50 | defaults write com.apple.dock "wvous-br-corner" -int 4 51 | defaults write com.apple.dock "wvous-br-modifier" -int 0 52 | } 53 | export -f setMissionControlHotCorners 54 | -------------------------------------------------------------------------------- /Usersettings/Music.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # Display «Playing next» Notification 4 | function showNextSongNotification(){ 5 | defaults write com.apple.Music "userWantsPlaybackNotifications" -bool TRUE 6 | } 7 | export -f showNextSongNotification 8 | -------------------------------------------------------------------------------- /Usersettings/Photos.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # Prevent Photos from opening automatically when devices are plugged in 4 | function preventAutoImportPhotos(){ 5 | defaults write com.apple.ImageCapture "disableHotPlug" -bool TRUE 6 | } 7 | export -f preventAutoImportPhotos 8 | -------------------------------------------------------------------------------- /Usersettings/SSHkey.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # Generate SSH Key 4 | function generateSSHKey(){ 5 | if checkIfNotEmpty "$gitUseremail"; then 6 | # --> Notify 7 | notify 8 | # --> Generate SSH Key 9 | ssh-keygen -t rsa -C $gitUseremail 10 | # --> Start SSH agent 11 | eval "$(ssh-agent -s)" 12 | # --> Add SSH Config file 13 | touch $HOME/.ssh/config 14 | echo "Host *" >> $HOME/.ssh/config 15 | echo " AddKeysToAgent yes" >> $HOME/.ssh/config 16 | echo " UseKeychain yes" >> $HOME/.ssh/config 17 | echo " IdentityFile ~/.ssh/id_rsa" >> $HOME/.ssh/config 18 | # --> Add SSH key locally 19 | ssh-add $HOME/.ssh/id_rsa 20 | 21 | # --> GitHub SSH Key config 22 | if checkIfNotEmpty "$gitUsername" && checkIfFileExists "$HOME/.ssh/id_rsa.pub"; then 23 | echo "Add this SSH Public Key on GitHub: https://github.com/settings/keys" 24 | # --> Notify 25 | notify 26 | pbcopy < $HOME/.ssh/id_rsa.pub 27 | else 28 | showinfo "Cannot execute: pbcopy < $HOME/.ssh/id_rsa.pub\n--> Try to run this command manually" "notice" 29 | fi 30 | else 31 | showinfo "No SSH Key configured, due to missing Git User Email !" "error" 32 | fi 33 | } 34 | export -f generateSSHKey 35 | -------------------------------------------------------------------------------- /Usersettings/Safari.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # -- Privacy -- 4 | # Don’t send search queries to Apple 5 | function privateSearchQueriesInSafari(){ 6 | defaults write com.apple.Safari "UniversalSearchEnabled" -bool FALSE 7 | defaults write com.apple.Safari "SuppressSearchSuggestions" -bool TRUE 8 | defaults write com.apple.Safari "SearchProviderShortName" -string "DuckDuckGo" 9 | } 10 | export -f privateSearchQueriesInSafari 11 | 12 | # Enable “Do Not Track” 13 | function noContentTrackingInSafari(){ 14 | defaults write com.apple.Safari "SendDoNotTrackHTTPHeader" -bool TRUE 15 | } 16 | export -f noContentTrackingInSafari 17 | 18 | 19 | # -- Security -- 20 | # Show the full URL in the address bar (note: this still hides the scheme) 21 | function showFullUrlInSafari(){ 22 | defaults write com.apple.Safari "ShowFullURLInSmartSearchField" -bool TRUE 23 | defaults write com.apple.Safari "ShowOverlayStatusBar" -bool TRUE 24 | } 25 | export -f showFullUrlInSafari 26 | 27 | # Prevent Safari from opening ‘safe’ files automatically after downloading 28 | function preventUnpackingDownloadedFilesInSafari(){ 29 | defaults write com.apple.Safari "AutoOpenSafeDownloads" -bool FALSE 30 | } 31 | export -f preventUnpackingDownloadedFilesInSafari 32 | 33 | # Warn about fraudulent websites 34 | function preventVisitingBadWebsitesInSafari(){ 35 | defaults write com.apple.Safari "WarnAboutFraudulentWebsites" -bool TRUE 36 | } 37 | export -f preventVisitingBadWebsitesInSafari 38 | 39 | # Update extensions automatically 40 | function preventOutdatedExtensionsInSafari(){ 41 | defaults write com.apple.Safari "InstallExtensionUpdatesAutomatically" -bool TRUE 42 | } 43 | export -f preventOutdatedExtensionsInSafari 44 | 45 | # Disable AutoFill 46 | function preventAutofillingYourDataInSafari(){ 47 | defaults write com.apple.Safari AutoFillFromAddressBook -bool FALSE 48 | defaults write com.apple.Safari AutoFillPasswords -bool FALSE 49 | defaults write com.apple.Safari AutoFillCreditCardData -bool FALSE 50 | defaults write com.apple.Safari AutoFillMiscellaneousForms -bool FALSE 51 | } 52 | export -f preventAutofillingYourDataInSafari 53 | 54 | # -- Website inspecting -- 55 | # Enable the Develop menu and the Web Inspector in Safari 56 | # Web views, add a contextual menu item for showing the Web Inspector 57 | function enableDeveloperToolsInSafari(){ 58 | defaults write NSGlobalDomain "WebKitDeveloperExtras" -bool TRUE 59 | defaults write com.apple.Safari "IncludeDevelopMenu" -bool TRUE 60 | defaults write com.apple.Safari "WebKitDeveloperExtrasEnabledPreferenceKey" -bool TRUE 61 | defaults write com.apple.Safari "com.apple.Safari.ContentPageGroupIdentifier.WebKit2DeveloperExtrasEnabled" -bool TRUE 62 | } 63 | export -f enableDeveloperToolsInSafari 64 | -------------------------------------------------------------------------------- /Usersettings/Screenshots.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # -- Screenshots settings -- 4 | # --> Don't add DateTime to Screenshot files 5 | function useNumericScreenshots(){ 6 | defaults write com.apple.screencapture "include-date" -bool FALSE 7 | } 8 | export -f useNumericScreenshots 9 | 10 | # --> Use different image format for Screenshots 11 | # Supported file types: png (default), bmp, gif, heic, jpg, jp2, tif, pict, pdf, tga, tiff 12 | function saveScreenshotsAs(){ 13 | local changeFormat=false 14 | local configUseScreenshotsFormat="$1" 15 | case "$configUseScreenshotsFormat" in 16 | png) changeFormat=false;; 17 | bmp|gif|heic|jpg|jp2|tif|pict|pdf|tga|tiff) changeFormat="$configUseScreenshotsFormat";; 18 | *) changeFormat=false;; 19 | esac 20 | 21 | # Screenshot format is valid and not default (png): 22 | if [ "$changeFormat" != false ]; then 23 | defaults write com.apple.screencapture "type" -string "$changeFormat" 24 | fi 25 | } 26 | export -f saveScreenshotsAs 27 | 28 | # --> Restart SystemUIServer 29 | function restartSystemUIServer(){ 30 | killall SystemUIServer 31 | } 32 | export -f restartSystemUIServer 33 | -------------------------------------------------------------------------------- /Usersettings/Spotlight.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # Hide Spotlight tray-icon (and subsequent helper) 4 | function hideSpotlightFromMenubar(){ 5 | #sudo chmod 600 /System/Library/CoreServices/Search.bundle/Contents/MacOS/Search 6 | # !! Command does not work under macOS 13.0 Ventura 7 | } 8 | export -f hideSpotlightFromMenubar 9 | 10 | # Disable Spotlight indexing for any volume that gets mounted and has not yet been indexed before. 11 | function disableSpotlightIndexingExternalDrives(){ 12 | #sudo defaults write /.Spotlight-V100/VolumeConfiguration Exclusions -array "/Volumes" 13 | # !! Command does not work under macOS 13.0 Ventura 14 | 15 | # --> Other options 16 | # Stop indexing any volume (including the macOS Harddrive). 17 | #sudo mdutil -a -i off 18 | # Add the macOS Harddrive back to being indexed by Spotlight 19 | #sudo mdutil -i on /Volumes/Macintosh\ HD 20 | } 21 | export -f disableSpotlightIndexingExternalDrives 22 | 23 | # Change indexing order and disable some search results 24 | function disableSpotlightSearchItems(){ 25 | # --> Some things are just not needed to be searched for... 26 | defaults write com.apple.spotlight orderedItems -array \ 27 | '{"enabled" = 1;"name" = "APPLICATIONS";}' \ 28 | '{"enabled" = 1;"name" = "CONTACT";}' \ 29 | '{"enabled" = 1;"name" = "DIRECTORIES";}' \ 30 | '{"enabled" = 1;"name" = "DOCUMENTS";}' \ 31 | '{"enabled" = 1;"name" = "IMAGES";}' \ 32 | '{"enabled" = 1;"name" = "PDF";}' \ 33 | '{"enabled" = 1;"name" = "PRESENTATIONS";}' \ 34 | '{"enabled" = 1;"name" = "SPREADSHEETS";}' \ 35 | '{"enabled" = 1;"name" = "SOURCE";}' \ 36 | '{"enabled" = 1;"name" = "MENU_DEFINITION";}' \ 37 | '{"enabled" = 1;"name" = "MENU_OTHER";}' \ 38 | '{"enabled" = 1;"name" = "MENU_CONVERSION";}' \ 39 | '{"enabled" = 1;"name" = "MENU_EXPRESSION";}' \ 40 | '{"enabled" = 1;"name" = "SYSTEM_PREFS";}' \ 41 | '{"enabled" = 0;"name" = "FONTS";}' \ 42 | '{"enabled" = 0;"name" = "MESSAGES";}' \ 43 | '{"enabled" = 0;"name" = "EVENT_TODO";}' \ 44 | '{"enabled" = 0;"name" = "BOOKMARKS";}' \ 45 | '{"enabled" = 0;"name" = "MUSIC";}' \ 46 | '{"enabled" = 0;"name" = "MOVIES";}' \ 47 | '{"enabled" = 0;"name" = "MENU_WEBSEARCH";}' \ 48 | '{"enabled" = 0;"name" = "MENU_SPOTLIGHT_SUGGESTIONS";}' 49 | 50 | # Load new settings before rebuilding the index 51 | killall mds > /dev/null 2>&1 52 | 53 | # Requires Admin privileges 54 | if checkIfUserIsAdmin; then 55 | # --> Notify first 56 | notify 57 | # Make sure indexing is enabled for the main volume 58 | sudo mdutil -i on / > /dev/null 59 | # Rebuild the index from scratch 60 | sudo mdutil -E / > /dev/null 61 | else 62 | showinfo "'mdutil' requires root privileges. Run with an admin user, or using sudo." "error" 63 | fi 64 | } 65 | export -f disableSpotlightSearchItems 66 | -------------------------------------------------------------------------------- /Usersettings/Terminal.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # --> Only use UTF-8 in Terminal.app 4 | function enableTerminalUtf8(){ 5 | defaults write com.apple.Terminal "StringEncodings" -array 4 6 | } 7 | export -f enableTerminalUtf8 8 | 9 | # --> Terminal custom Profile-Theme 10 | function downloadTerminalCustomTheme(){ 11 | downloadFromUrl "$useCustomTerminalThemeURL" "MyCustomTheme.terminal" 12 | importTerminalCustomTheme 13 | setTerminalCustomThemeAsDefault 14 | } 15 | export -f downloadTerminalCustomTheme 16 | 17 | # --> Import the custom Terminal theme 18 | function importTerminalCustomTheme(){ 19 | osascript < Apply custom Terminal Commands 38 | function downloadTerminalzshrcContents(){ 39 | local zshrcContentsLocation=$HOME/Downloads/Add\ to\ zshrc.txt 40 | downloadFromUrl "$useCustomTerminalConfigurationsURL" "$zshrcContentsLocation" 41 | if checkIfFileExists "$zshrcContentsLocation"; then 42 | "$zshrcContentsLocation" >> $HOME/.zshrc 43 | fi 44 | } 45 | export -f downloadTerminalzshrcContents 46 | -------------------------------------------------------------------------------- /Usersettings/TextEdit.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | function enableTextEditPlaintext(){ 4 | # Use plain text mode for new TextEdit documents 5 | defaults write com.apple.TextEdit "RichText" -int 0 6 | 7 | # Open and save files as UTF-8 in TextEdit 8 | defaults write com.apple.TextEdit "PlainTextEncoding" -int 4 9 | defaults write com.apple.TextEdit "PlainTextEncodingForWrite" -int 4 10 | } 11 | 12 | # Text, disable auto-correct 13 | function disableTextAutocorrect(){ 14 | defaults write NSGlobalDomain "NSAutomaticSpellingCorrectionEnabled" -bool FALSE 15 | defaults write NSGlobalDomain "WebAutomaticSpellingCorrectionEnabled" -bool FALSE 16 | } 17 | export -f disableTextAutocorrect 18 | 19 | # Text, disable automatic capitalisation 20 | function disableTextCapitalisation(){ 21 | defaults write NSGlobalDomain "NSAutomaticCapitalizationEnabled" -bool FALSE 22 | } 23 | export -f disableTextCapitalisation 24 | 25 | # Text, disable automatic period substitution 26 | function disableTextPeriodSubstitution(){ 27 | defaults write NSGlobalDomain "NSAutomaticPeriodSubstitutionEnabled" -bool FALSE 28 | } 29 | export -f disableTextPeriodSubstitution 30 | -------------------------------------------------------------------------------- /Usersettings/Trackpad.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # -- MacBook Trackpad behaviours -- 4 | # --> Improve Trackpad Click behaviours (single and right click) 5 | function enableTrackpadClicking(){ 6 | # Enable Single Tap to Click 7 | defaults write com.apple.AppleMultitouchTrackpad "Clicking" -int 1 8 | # Enable Right Click 9 | defaults write com.apple.driver.AppleBluetoothMultitouch.mouse MouseButtonMode -string 'TwoButton' 10 | defaults write com.apple.AppleMultitouchTrackpad "TrackpadRightClick" -int 1 11 | } 12 | export -f enableTrackpadClicking 13 | 14 | # --> Increase Mouse speed on Trackpads and Mouses 15 | function increaseMouseSpeed(){ 16 | defaults write NSGlobalDomain com.apple.trackpad.scaling -int 2 17 | defaults write NSGlobalDomain com.apple.mouse.scaling -float 1.5 18 | } 19 | export -f increaseMouseSpeed 20 | 21 | # --> Disable Mouse cursor acceleration 22 | function disableMouseAcceleration(){ 23 | defaults write NSGlobalDomain com.apple.mouse.linear -bool YES 24 | 25 | } 26 | export -f disableMouseAcceleration 27 | -------------------------------------------------------------------------------- /Usersettings/Userhome.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # -- Userhome Files + Folders -- 4 | # --> Unhide Library folder 5 | function showUserhomeLibraryFolder(){ 6 | chflags nohidden $HOME/Library 7 | #xattr -d com.apple.FinderInfo ~/Library # errors: No such xattr: com.apple.FinderInfo 8 | } 9 | export -f showUserhomeLibraryFolder 10 | -------------------------------------------------------------------------------- /config.default.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # ----------------------------------------------- 4 | # INSTRUCTIONS 5 | # --- 6 | # Copy this file as a "config.sh" and set your 7 | # preferences for the options using "true" or "false" 8 | # (if there is no config.sh, the default file is used) 9 | # 10 | # 11 | # TABLE OF CONTENTS 12 | # --- 13 | # 1. macOS System Services 14 | # |- 1.1 Security 15 | # |- 1.2 Time Machine 16 | # |- 1.3 AirDrop 17 | # |_ 1.4 System Updates 18 | # |_ 1.5 Performance 19 | # |_ 1.6 System boot 20 | # 21 | # 2. Applications 22 | # |- 2.1 Remove Applications 23 | # |- 2.2 Required Apps 24 | # |- 2.3 Finder Extensions 25 | # |- 2.4 Application installations 26 | # |_ 2.5 Web Development Suite 27 | # |_ 2.6 Mac Gaming 28 | # 29 | # 3. User Settings 30 | # |- 3.1 Layout / User Interface 31 | # |- 3.2 Finder 32 | # |- 3.3 Dock 33 | # |- 3.4 User Home 34 | # |- 3.5 Terminal 35 | # |_ 3.6 Application Hardening 36 | # 37 | 38 | # ------------------------------ 39 | # 1. macOS System Services 40 | # ------------------------------ 41 | # -- 1.1 Security -- 42 | useFileVault=true 43 | enableFirewall=true 44 | disableShutdownRestartInLogin=true 45 | enableScreensaverPassword=true 46 | 47 | # -- 1.2 Time Machine -- 48 | speedupTimemachine=true 49 | 50 | # -- 1.3 AirDrop -- 51 | enableWiredAirDrop=true 52 | 53 | # -- 1.4 Check and install System updates -- 54 | installSystemUpdates=true 55 | 56 | # -- 1.5 Performance settings -- 57 | betterApplicationPerformance=true 58 | 59 | # -- 1.6 System boot up -- 60 | playMacStartupSound=true 61 | 62 | 63 | # ------------------------------ 64 | # 2. Applications 65 | # ------------------------------ 66 | # -- 2.1 Remove pre-installed Apps -- 67 | removeGarageband=false 68 | removeiMovie=false 69 | 70 | # -- 2.2 Required Applications -- 71 | # (others have dependencies for these) 72 | installXcodeTools=false 73 | installHomebrew=true 74 | installAppStoreApps=true # <-- requires Homebrew=TRUE 75 | installRosetta=false 76 | 77 | # -- 2.3 Install Finder Extensions -- 78 | installKeka=true 79 | installSyntaxHighlightQuickLook=true 80 | 81 | # -- 2.4 Install Applications -- 82 | install1Password=false 83 | installAdGuardSafari=true 84 | installAlDente=false # <-- only supported on MacBooks (MBA, MBP) 85 | installBeyondCompare=false 86 | installBraveBrowser=false 87 | installDiscord=false 88 | installEqMac=false 89 | installFigma=false 90 | installFirefox=false 91 | installGoogleChrome=false 92 | installGrandPerspective=false 93 | installLinearMouse=false 94 | installMacsFanControl=false 95 | installMicrosoftOffice=false 96 | installNova=false 97 | installOverSight=true 98 | installPixelmator=false 99 | installSpotify=false 100 | installStrongbox=false 101 | installTelegram=false 102 | installTransmission=false 103 | installTresorit=false 104 | installVisualStudioCode=false 105 | installVLC=false 106 | installWarp=false 107 | installXnapper=false 108 | 109 | # -- 2.5 Web Development Suite -- 110 | installWebdevTools=false # <-- When FALSE then all below steps are SKIPPED 111 | installGit=false 112 | gitUsername='' # <-- Name to use with Git 113 | gitUseremail='' # <-- Email to use with Git 114 | installBoop=false 115 | installComposer=false # <-- will also install PHP 116 | installDocker=false # <-- only installed when MAMP=FALSE 117 | useOrbStackOverDocker=false # <-- use OrbStack instead of Docker 118 | installFork=false 119 | installGasMask=false 120 | installMAMP=false 121 | installSequelAce=false 122 | installSonarQube=false # <-- only installed when Docker=TRUE 123 | 124 | # -- 2.6 Mac Gaming Apps and Games -- 125 | installHeroicGamesLauncher=false 126 | installSteam=false 127 | installWhisky=false 128 | 129 | # ------------------------------ 130 | # 3. User and App Settings 131 | # ------------------------------ 132 | # -- 3.1 macOS Layout / User Interface -- 133 | # ---- 3.1.1 Menu Bar ---- 134 | dateTimeInMenubar=true 135 | enableFastUserswitching=true 136 | useMissionControl=true 137 | disableTransparency=true 138 | showBatteryPercentage=true # <-- only applied on MacBooks (MBA, MBP) 139 | # ---- 3.1.2 Window handling ---- 140 | enableFullDraggableWindows=false 141 | showScrollbars=true 142 | # ---- 3.1.3 Text handling ---- 143 | disableAnnoyingTextcorrections=true 144 | # ---- 3.1.4 Keyboard & Mouse ---- 145 | disableNaturalScrolling=true 146 | enableTrackpadClicks=true # <-- only applied on MacBooks (MBA, MBP) 147 | fasterMouseCursor=true 148 | fnKeyFunction='emoji' # Modes: off=Do nothing, emoji=Emojis & Symbols, language=Input sources, dictation=Start Dictation 149 | # ---- 3.1.5 Apple Apps ---- 150 | useRealNamesForContacts=true 151 | showMusicNextSongPlaying=false 152 | showSubjectInMessagesApp=false 153 | 154 | # -- 3.2 macOS Finder customizations -- 155 | customizeFinder=true # <-- If false, below settings will have NO effect 156 | useScreenshotsFormat='png' # Supported formats: bmp, gif, heic, jpg, jp2, tif, pict, pdf, png, tga, tiff 157 | useScreenshotsNumericFilename=false 158 | 159 | # -- 3.3 macOS Dock optimizations -- 160 | speedupDock=true 161 | beautifyDock=true 162 | minimalDock=false 163 | 164 | # -- 3.4 User Home folder -- 165 | showLibraryFolder=true 166 | addUserApplicationsFolder=true 167 | addUserWebsitesFolder=true 168 | # ---- 3.4.1 «Games» folder ---- 169 | addUserGamesFolder=true 170 | useCustomGamesFolderIcon=true # <-- Requires Games Folder (addUserGamesFolder=TRUE) 171 | useCustomGamesFolderIconURL='https://swissmacuser.ch/wp-content/uploads/2021/06/Games-Folder-Icon-macOS-12-Monterey-detailed.png' 172 | # ---- 3.4.2 Wallpapers (Desktop Pictures) ---- 173 | downloadWallpapers=true # <-- Required to download any Wallpapers 174 | dynamicWallpaperExodus=false 175 | dynamicWallpaperFuji=false 176 | dynamicWallpaperISS=false 177 | 178 | # -- 3.5 Terminal app settings -- 179 | enableTerminalUtf8=true 180 | useCustomTerminalTheme=false # <-- Requires the URL from next line to download .terminal Theme file 181 | useCustomTerminalThemeURL='https://gist.githubusercontent.com/oliveratgithub/c9dde424966a7b9b5b7e9d1c28bf8f2e/raw/' 182 | useCustomTerminalConfigurations=false # If true, a URL is required to download and apply .zhsrc commands 183 | useCustomTerminalConfigurationsURL='' 184 | 185 | # -- 3.6 Application Hardening -- 186 | secureSafariBrowser=true 187 | removeTrashbinItemsPeriodically=true # Auto-remove items from Trash after 30 days 188 | -------------------------------------------------------------------------------- /helpers.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # Send a Beep to get attention in the Terminal 4 | function notify(){ 5 | afplay /System/Library/Sounds/Blow.aiff 6 | open /System/Applications/Utilities/Terminal.app 7 | } 8 | export -f notify 9 | 10 | # echo a string to the CLI 11 | function showinfo(){ 12 | # Define font style 13 | local REGULAR=$(tput sgr0) 14 | local BOLD=$(tput bold) 15 | # Define colors 16 | local NOCOLOR='\033[0m' 17 | local GREEN='\033[0;32m' 18 | local BLUE='\033[0;34m' 19 | local RED='\033[0;31m' 20 | local YELLOW='\033[1;33m' 21 | local GRAY='\033[1;30m' 22 | 23 | # Check if 2nd Parameter is passed 24 | if [ -n "$2" ]; then 25 | case "$2" in 26 | note) echout="\n$1";; 27 | shout) echout="\n\n${BLUE}$1\n------------------------------${NOCOLOR}";; 28 | confirm) echout="$1...${GREEN}done ✅${NOCOLOR}\n";; 29 | error) echout="\n❌ ${RED}$1${NOCOLOR}\n";; 30 | notice) echout="\n💡 ${YELLOW}$1${NOCOLOR}\n";; 31 | blank) echout="";; 32 | *) echout="$1";; 33 | esac 34 | else 35 | echout="$1" 36 | fi 37 | echo -e "$echout" 38 | } 39 | export -f showinfo 40 | 41 | # Check if a variable is not empty and not whitespace 42 | function checkIfNotEmpty() { 43 | if [ -n "$1" ]; then 44 | # Is NOT empty 45 | return 0 # true 46 | else 47 | # Is empty 48 | return 1 # false 49 | fi 50 | } 51 | export -f checkIfNotEmpty 52 | 53 | # Check if a local path exists and is readable 54 | function checkIfFileExists(){ 55 | if [ -r "$1" ]; then 56 | # Found (and readable) 57 | return 0 # true 58 | else 59 | # Does not exist 60 | return 1 # false 61 | fi 62 | } 63 | export -f checkIfFileExists 64 | 65 | # Check if Mac is Apple Silicon (otherwise Intel x86) 66 | function checkIfAppleSilicion(){ 67 | # Intel=x86_64 | AppleSilicon=arm64 68 | if uname -m | grep -q -w arm64; then 69 | return 0 # true 70 | else 71 | return 1 # false 72 | fi 73 | } 74 | export -f checkIfAppleSilicion 75 | 76 | # Check if Mac is portable 77 | # (MacBook, MacBook Air, MacBook Pro) 78 | function checkIfMacIsPortable(){ 79 | if system_profiler -detailLevel mini SPHardwareDataType | grep -q Book; then 80 | return 0 # true 81 | else 82 | return 1 # false 83 | fi 84 | } 85 | export -f checkIfMacIsPortable 86 | 87 | # Check if Xcode Command Line Tools are installed 88 | function checkIfXcodeInstalled(){ 89 | local XcodeCLTinstallPath="/Library/Developer/CommandLineTools" 90 | if [ "$(xcode-select -p)" != "$XcodeCLTinstallPath" ]; then 91 | # Not installed 92 | return 1 # false 93 | else 94 | # Installed 95 | return 0 # true 96 | fi 97 | } 98 | export -f checkIfXcodeInstalled 99 | 100 | # Check if Homebrew is installed 101 | function checkIfHomebrewInstalled(){ 102 | local HomebrewInstallPath="/opt/homebrew/bin/brew" 103 | if ! command -v brew &> /dev/null || [ "$(command -v brew)" != "$HomebrewInstallPath" ]; then 104 | # Not installed 105 | return 1 # false 106 | else 107 | # Installed 108 | return 0 # true 109 | fi 110 | } 111 | export -f checkIfHomebrewInstalled 112 | 113 | # Check if User has authenticated to App Store 114 | function checkIfAppStoreAuthenticated(){ 115 | if ! command -v mas &> /dev/null; then 116 | # Not authenticated 117 | return 1 # false 118 | else 119 | # Authenticated 120 | return 0 # true 121 | fi 122 | } 123 | export -f checkIfAppStoreAuthenticated 124 | 125 | # Get logged-in user's Username 126 | function getUsername(){ 127 | local whoami="$(id -un)" 128 | echo whoami 129 | return 0 130 | } 131 | export -f getUsername 132 | 133 | # Check if current User is in admin group 134 | # Source: https://apple.stackexchange.com/a/179531/86244 135 | function checkIfUserIsAdmin(){ 136 | if groups $USER | grep -q -w admin; then 137 | # User is admin 138 | return 0 # true 139 | else 140 | # User is NOT admin 141 | return 1 # false 142 | fi 143 | } 144 | export -f checkIfUserIsAdmin 145 | 146 | function macosGatekeeper(){ 147 | if checkIfNotEmpty "$1"; then 148 | # --> Notify first 149 | notify 150 | # Requires Admin privileges 151 | if checkIfUserIsAdmin; then 152 | if [ "$1" = "on" ]; then 153 | # ENABLE Gatekeeper (Allow apps from "App Store and identified developers") 154 | sudo spctl --master-enable 155 | elif [ "$1" = "off" ]; then 156 | # DISABLE Gatekeeper (Allow apps from "Anywhere") 157 | sudo spctl --master-disable 158 | fi 159 | else 160 | showinfo "'spctl' requires root privileges. Run with an admin user, or using sudo." "error" 161 | fi 162 | else 163 | # Get current Gatekeeper status 164 | if spctl --status | grep -q -w enabled; then 165 | return 0 # enabled 166 | else 167 | return 1 # disabled 168 | fi 169 | fi 170 | } 171 | export -f macosGatekeeper 172 | 173 | # Download a file from a given URL using curl 174 | function downloadFromUrl(){ 175 | # Check that the URL and destination file name are valid 176 | if checkIfNotEmpty "$1" && checkIfNotEmpty "$2"; then 177 | local downloadFolder="$HOME/Downloads/" 178 | local downloadPath="$downloadFolder$2" 179 | 180 | # Use curl to fetch the URL and store the resource 181 | # -S = silent, but allow errors & progress bar 182 | # -L = follow HTTP redirects 183 | # -f = fail silently on server errors 184 | # -# = show a progress bar (instead of a table) 185 | # -A = use a custom User Agent string 186 | curl -SLf\# "$1" -o "$downloadPath" -A "macOS-scripted-setup/1.0 (compatible; +https://github.com/Swiss-Mac-User/macOS-scripted-setup)" 187 | else 188 | showinfo "Missing URL or download target path" "error" 189 | fi 190 | } 191 | export -f downloadFromUrl 192 | 193 | # Unzip a ZIP-file in place 194 | function unzipFile(){ 195 | local downloadFolder="$HOME/Downloads/" 196 | local filePath="$downloadFolder$1" 197 | if checkIfFileExists "$filePath"; then 198 | unzip -qq "$filePath" -d "$downloadFolder" 199 | else 200 | showinfo "ZIP file not found:\n$filePath" "error" 201 | fi 202 | } 203 | export -f unzipFile 204 | 205 | # Unmount a DMG-image and copy App to Downloads folder 206 | function unmountFile(){ 207 | local downloadFolder="$HOME/Downloads/" 208 | local filePath="$downloadFolder$1" 209 | if checkIfFileExists "$filePath" && checkIfNotEmpty "$2"; then 210 | local appFilename="$2.app" 211 | # --> Mount Volume 212 | hdiutil attach "$filePath" -quiet 213 | # --> Move to Applications (suppress errors) 214 | cp -r "/Volumes/$2/$2.app" "$downloadFolder" 215 | # --> Unmount Volume 216 | hdiutil unmount "/Volumes/$2" -force -quiet 217 | else 218 | showinfo "Missing file path or Application name" "error" 219 | return 1 # error 220 | fi 221 | } 222 | export -f unmountFile 223 | 224 | # Move an Application to the User or System Applications folder 225 | # (and optionally open it upon moving) 226 | function moveApplication(){ 227 | if checkIfNotEmpty "$1"; then 228 | local downloadedApplicationPath="$HOME/Downloads/$1" 229 | 230 | if checkIfFileExists "$downloadedApplicationPath"; then 231 | if checkIfFileExists "$HOME/Applications/"; then 232 | local ApplicationsDir="$HOME/Applications/" 233 | else 234 | local ApplicationsDir="/Applications/" 235 | fi 236 | 237 | # Disable Quarantine for App (not working on macOS 13+) 238 | #disableAppQuarantine "$downloadedApplicationPath" 239 | 240 | # Move the Application file 241 | mv "$downloadedApplicationPath" "$ApplicationsDir" 242 | 243 | # Open App, if required 244 | if checkIfNotEmpty "$2" && [ "$2" = "open" ]; then 245 | open -gj "$ApplicationsDir$1" 246 | fi 247 | else 248 | showinfo "Cannot move Application '$1'\nPath not found: $downloadedApplicationPath" "error" 249 | return 1 # error 250 | fi 251 | else 252 | showinfo "No Application name provided" "error" 253 | return 1 # error 254 | fi 255 | } 256 | export -f moveApplication 257 | 258 | # Remove XProtect quarantine flags from a macOS File or Folder 259 | function disableAppQuarantine(){ 260 | if checkIfFileExists "$1"; then 261 | xattr -cr "$1" 262 | fi 263 | } 264 | export -f disableAppQuarantine 265 | -------------------------------------------------------------------------------- /mycommands.template.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # 1) Duplicate - or rename - this file to "mycommands.sh" (important!) 4 | # 2) Below this line, add any custom shell commands to run consecutively (at the very end of the setup)... 5 | 6 | -------------------------------------------------------------------------------- /run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # ------------------------------ 4 | # INITIALIZE 5 | # ------------------------------ 6 | # Load Helper functions persistently 7 | source helpers.sh > /dev/null 8 | 9 | # Load the right configuration file 10 | showinfo "Loading setup configuration" "shout" 11 | if checkIfFileExists "config.sh"; then 12 | # Load CUSTOM configs 13 | source config.sh > /dev/null 14 | showinfo "custom configs (config.sh)" "confirm" 15 | else 16 | # Fallback: Load DEFAULT configs 17 | source config.default.sh > /dev/null 18 | showinfo "default configs (config.default.sh)" "confirm" 19 | fi 20 | 21 | 22 | 23 | # ------------------------------ 24 | # SETUP MACOS SYSTEM SERVICES 25 | # ------------------------------ 26 | showinfo "SETUP MACOS SYSTEM SERVICES" "shout" 27 | for service in ./Systemservices/*.sh; do 28 | [ -r "$service" ] && source $service > /dev/null 29 | done 30 | unset service 31 | # -- FileVault2 -- 32 | if [ "$useFileVault" = true ]; then 33 | showinfo "Enabling FileVault:" "note" 34 | enableFileVault 35 | showinfo "" "confirm" 36 | fi 37 | # -- Built-in Firewall -- 38 | if [ "$enableFirewall" = true ]; then 39 | showinfo "Enabling Firewall Stealthmode:" "note" 40 | activateFirewallStealthmode 41 | showinfo "" "confirm" 42 | showinfo "Enabling Firewall:" "note" 43 | enableFirewall 44 | showinfo "" "confirm" 45 | fi 46 | # -- Time Machine -- 47 | if [ "$speedupTimemachine" = true ]; then 48 | showinfo "Disabling Time Machine prompts for new connected drives:" "note" 49 | muteTimeMachine 50 | showinfo "" "confirm" 51 | showinfo "Throttling Time Machine process priority:" "note" 52 | speedupTimeMachine 53 | showinfo "" "confirm" 54 | fi 55 | # -- AirDrop -- 56 | if [ "$enableWiredAirDrop" = true ]; then 57 | showinfo "Enabling AirDrop through Ethernet:" "note" 58 | enableAirDropOnEthernet 59 | showinfo "" "confirm" 60 | fi 61 | # -- Login and Password -- 62 | if [ "$disableShutdownRestartInLogin" = true ]; then 63 | showinfo "Disabling 'Shutdown' button on Login window:" "note" 64 | disableShutdownOnLogin 65 | showinfo "" "confirm" 66 | showinfo "Disabling 'Restart' button on Login window:" "note" 67 | disableRestartOnLogin 68 | showinfo "" "confirm" 69 | fi 70 | if [ "$enableScreensaverPassword" = true ]; then 71 | showinfo "Enabling password prompt when interrupting Screensaver:" "note" 72 | enableUserpasswordOnScreensaver 73 | showinfo "" "confirm" 74 | fi 75 | if [ "$playMacStartupSound" = true ]; then 76 | showinfo "Enabling the iconic Startup Chime on your Mac:" "note" 77 | enableStartupChime 78 | showinfo "" "confirm" 79 | fi 80 | 81 | 82 | 83 | # ------------------------------ 84 | # APPLY USER SETTINGS 85 | # ------------------------------ 86 | showinfo "APPLY USER SETTINGS" "shout" 87 | for setting in ./Usersettings/*.sh; do 88 | [ -r "$setting" ] && source $setting > /dev/null 89 | done 90 | unset setting 91 | 92 | # -- Application Performance -- 93 | if [ "$betterApplicationPerformance" = true ]; then 94 | showinfo "Disabling App Nap (application power saving):" "note" 95 | disableAppNap 96 | setActivityMonitorProcesslist 97 | showinfo "" "confirm" 98 | fi 99 | 100 | # -- macOS Layout -- 101 | if [ "$dateTimeInMenubar" = true ]; then 102 | showinfo "Setting analog Menu Clock:" "note" 103 | setReadableMenuclock 104 | showinfo "" "confirm" 105 | fi 106 | if [ "$showScrollbars" = true ]; then 107 | showinfo "Setting always visible Scrollbars:" "note" 108 | alwaysShowScrollbars 109 | showinfo "" "confirm" 110 | fi 111 | if [ "$disableNaturalScrolling" = true ]; then 112 | showinfo "Disabling Natural Scrolling:" "note" 113 | disableNaturalScrolling 114 | showinfo "" "confirm" 115 | fi 116 | if [ "$disableTransparency" = true ]; then 117 | showinfo "Disabling transparencies and tinting (windows, menubar):" "note" 118 | disableTransparencyAndTinting 119 | showinfo "" "confirm" 120 | fi 121 | if [ "$useRealNamesForContacts" = true ]; then 122 | showinfo "Enable using real names for Contacts (instead of Nicknames):" "note" 123 | disableContactstNicknames 124 | showinfo "" "confirm" 125 | fi 126 | 127 | # -- Mission Control -- 128 | if [ "$useMissionControl" = true ]; then 129 | showinfo "Configuring Mission Control:" "note" 130 | setMissionControlHotCorners 131 | groupMissionControlByApplication 132 | switchMissionControlSpacesByApplication 133 | useMissionControlSpacePerDisplay 134 | showinfo "" "confirm" 135 | fi 136 | 137 | # -- Control Centre -- 138 | if [ "$enableFastUserswitching" = true ]; then 139 | showinfo "Enabling Fast User Switching:" "note" 140 | enableFastUserSwitching 141 | showFastUserSwitching 142 | showinfo "" "confirm" 143 | fi 144 | if [ "$showBatteryPercentage" = true ] && checkIfMacIsPortable; then 145 | showinfo "Show Battery %-Percentage:" "note" 146 | showBatteryPercentage 147 | showinfo "" "confirm" 148 | fi 149 | 150 | # -- macOS Text / Keyboard Input -- 151 | if [ "$disableAnnoyingTextcorrections" = true ]; then 152 | showinfo "Disabling annoying automatic Text corrections:" "note" 153 | disableTextAutocorrect 154 | disableTextCapitalisation 155 | disableTextPeriodSubstitution 156 | showinfo "" "confirm" 157 | fi 158 | if [ "$enableTrackpadClicks" = true ] && checkIfMacIsPortable; then 159 | showinfo "Enable Tap to Click on the Trackpad:" "note" 160 | enableTrackpadClicking 161 | showinfo "" "confirm" 162 | fi 163 | if [ "$fasterMouseCursor" = true ]; then 164 | showinfo "Speedup Cursor on Trackpads and Mouses:" "note" 165 | increaseMouseSpeed 166 | showinfo "" "confirm" 167 | fi 168 | if [ "$fnKeyFunction" != 'off' ] || [ "$fnKeyFunction" != false ]; then 169 | showinfo "Changing fn 🌐 key functionality:" "note" 170 | useFnKeyFor "$fnKeyFunction" 171 | showinfo "" "confirm" 172 | fi 173 | 174 | # -- Dock -- 175 | if [ "$speedupDock" = true ]; then 176 | showinfo "Enabling auto-hiding the Dock:" "note" 177 | autohideDock 178 | showinfo "" "confirm" 179 | showinfo "Making the Dock hide/show much snappier:" "note" 180 | speedupDock 181 | showinfo "" "confirm" 182 | fi 183 | if [ "$beautifyDock" = true ]; then 184 | showinfo "Remove all default App Icons from the Dock:" "note" 185 | clearDock 186 | showinfo "" "confirm" 187 | showinfo "Disabling recent Apps from the Dock:" "note" 188 | noRecentAppsInDock 189 | showinfo "" "confirm" 190 | showinfo "Enabling dimming hidden Apps in the Dock:" "note" 191 | dimHiddenAppsInDock 192 | indicateRunningAppsInDock 193 | showinfo "" "confirm" 194 | fi 195 | if [ "$minimalDock" = true ]; then 196 | showinfo "Showing only active Apps in the Dock:" "note" 197 | showOnlyRunningAppsInDock 198 | showinfo "" "confirm" 199 | fi 200 | restartDock 201 | 202 | # -- Finder -- 203 | if [ "$customizeFinder" = true ]; then 204 | showinfo "Customizing the macOS Finder:" "notice" 205 | 206 | # --> Photos handling when Apple Devices connected 207 | showinfo "Disabling auto-import of Photos (from connected Apple Devices):" "note" 208 | preventAutoImportPhotos 209 | showinfo "" "confirm" 210 | 211 | # -- Finder windows & folders -- 212 | showinfo "Improving Finder windows and dialogues:" "note" 213 | disableMetadataFilesOnNetworkshares 214 | disableMetadataFilesOnExternalDrives 215 | saveToDiskInsteadOfiCloud 216 | showAllFileExtensions 217 | expandAllSavePanels 218 | expandAllPrintPanels 219 | minimizeWindowsOnDoubleclick 220 | alwaysConfirmClose 221 | disableEmptyTrashWarning 222 | alwaysSaveWindowstateOnQuit 223 | useSmallIconsInSidebar 224 | showStatusAndPathBars 225 | defaultSearchCurrentFolder 226 | defaultNewWindowLocation 227 | showVolumeIconsOnDesktop 228 | enableSnapToGrid 229 | updateApplicationsFolderListColumns 230 | if [ "$enableFullDraggableWindows" = true ]; then 231 | showinfo "Making all windows fully draggable using ⌘Command+^Control+Click:" "note" 232 | enableFullWindowDragzone 233 | fi 234 | if [ "$removeTrashbinItemsPeriodically" = true ]; then 235 | showinfo "Trash bin: automatically remove items after 30 days:" "note" 236 | enableTrashAutoremove30days 237 | fi 238 | showinfo "" "confirm" 239 | 240 | # --> Screenshots 241 | showinfo "Improving Screenshots:" "note" 242 | saveScreenshotsAs "$useScreenshotsFormat" 243 | if [ "$useScreenshotsNumericFilename" = true ]; then 244 | useNumericScreenshots 245 | fi 246 | showinfo "" "confirm" 247 | 248 | # --> Text Edit 249 | showinfo "Setting Text Edit default document format to Plain-Text:" "note" 250 | enableTextEditPlaintext 251 | showinfo "" "confirm" 252 | 253 | # --> Spotlight 254 | showinfo "Improving Spotlight:" "note" 255 | hideSpotlightFromMenubar 256 | disableSpotlightIndexingExternalDrives 257 | disableSpotlightSearchItems 258 | showinfo "" "confirm" 259 | 260 | showinfo "Restarting Finder and SystemUIServer service:" "note" 261 | restartSystemUIServer 262 | restartFinder 263 | showinfo "" "confirm" 264 | fi 265 | # -- Apple Apps -- 266 | if [ "$showMusicNextSongPlaying" = true ]; then 267 | showinfo "Show «Playing next» notification from Music App:" "note" 268 | showNextSongNotification 269 | showinfo "" "confirm" 270 | fi 271 | if [ "$showSubjectInMessagesApp" = true ]; then 272 | showinfo "Show the Subject field in Messages App:" "note" 273 | enableMessagesSubjectField 274 | showinfo "" "confirm" 275 | fi 276 | 277 | # -- Safari -- 278 | if [ "$secureSafariBrowser" = true ]; then 279 | showinfo "More Privacy and Security for Safari:" "notice" 280 | # --> Private 281 | showinfo "Enabling Private Search and No Tracking:" "note" 282 | privateSearchQueriesInSafari 283 | noContentTrackingInSafari 284 | showinfo "" "confirm" 285 | # --> Security 286 | showinfo "Enabling all Security features in Safari:" "note" 287 | showFullUrlInSafari 288 | preventUnpackingDownloadedFilesInSafari 289 | preventVisitingBadWebsitesInSafari 290 | preventOutdatedExtensionsInSafari 291 | preventAutofillingYourDataInSafari 292 | enableDeveloperToolsInSafari 293 | showinfo "" "confirm" 294 | fi 295 | 296 | # -- Userhome Files + Folders -- 297 | for filesetting in ./FilesFolders/*.sh; do 298 | [ -r "$filesetting" ] && source $filesetting > /dev/null 299 | done 300 | unset filesetting 301 | showinfo "CREATING ADDITIONAL FOLDERS AND FILES" "shout" 302 | # --> ZSH profile configuration file 303 | showinfo "Adding a ~/.zprofile ZSH Shell config file to userhome:" "note" 304 | createUserFileZprofile 305 | showinfo "" "confirm" 306 | # --> Library folder 307 | if [ "$showLibraryFolder" = true ]; then 308 | showinfo "Making the ~/Library folder in userhome visible:" "note" 309 | showUserhomeLibraryFolder 310 | showinfo "" "confirm" 311 | fi 312 | # --> Applications 313 | if [ "$addUserApplicationsFolder" = true ]; then 314 | showinfo "Adding a ~/Applications folder to userhome:" "note" 315 | createUserFolderApplications 316 | showinfo "" "confirm" 317 | fi 318 | # --> Sites 319 | if [ "$addUserWebsitesFolder" = true ]; then 320 | showinfo "Adding a ~/Sites folder to userhome:" "note" 321 | createUserFolderSites 322 | showinfo "" "confirm" 323 | fi 324 | # --> Games 325 | if [ "$addUserGamesFolder" = true ]; then 326 | showinfo "Adding a ~/Games folder to userhome:" "note" 327 | createUserFolderGames 328 | showinfo "" "confirm" 329 | fi 330 | # --> Desktop Pictures 331 | if [ "$downloadWallpapers" = true ]; then 332 | showinfo "Adding Desktop Pictures folder to userhome ~/Pictures/:" "note" 333 | createUserFolderDesktopPictures 334 | showinfo "" "confirm" 335 | 336 | if [ "$dynamicWallpaperExodus" = true ]; then 337 | showinfo "...downloading «Exodus» wallpaper to ~/Pictures/Desktop Pictures/" "note" 338 | downloadWallpaperExodus 339 | fi 340 | if [ "$dynamicWallpaperFuji" = true ]; then 341 | showinfo "...downloading «Fuji» wallpaper to ~/Pictures/Desktop Pictures/" "note" 342 | downloadWallpaperFuji 343 | fi 344 | if [ "$dynamicWallpaperISS" = true ]; then 345 | showinfo "...downloading «ISS» wallpaper to ~/Pictures/Desktop Pictures/" "note" 346 | downloadWallpaperISS 347 | fi 348 | showinfo "" "confirm" 349 | fi 350 | 351 | 352 | 353 | # ------------------------------ 354 | # APPLICATION INSTALLATIONS 355 | # 356 | # Note: 357 | # open -g Do not bring the application to the foreground. 358 | # -j Launches the app hidden. 359 | # ------------------------------ 360 | showinfo "APPLICATION INSTALLATIONS" "shout" 361 | for app in ./Applications/*.sh; do 362 | [ -r "$app" ] && source $app > /dev/null 363 | done 364 | unset app 365 | # -- DISABLE macOS Gatekeepr (if enabled) -- 366 | if macosGatekeeper; then 367 | showinfo "DISABLING Gatekeeper to allow unsiged Applications:" "note" 368 | macosGatekeeper "off" 369 | showinfo "" "confirm" 370 | fi 371 | # -- REMOVE pre-installed large Apps -- 372 | if [ "$removeGarageband" = true ]; then 373 | showinfo "Removing Garageband App:" "note" 374 | removeAppGarageband 375 | showinfo "(removed if present)" "confirm" 376 | fi 377 | if [ "$removeiMovie" = true ]; then 378 | showinfo "Removing iMovie App:" "note" 379 | removeAppiMovie 380 | showinfo "(removed if present)" "confirm" 381 | fi 382 | # -- Rosetta for macOS -- 383 | if [ "$installRosetta" = true ]; then 384 | showinfo "Installing Rosetta:" "note" 385 | installAppRosetta 386 | showinfo "" "confirm" 387 | fi 388 | # -- Keka.app -- 389 | if [ "$installKeka" = true ]; then 390 | showinfo "Installing Keka:" "note" 391 | installAppKeka 392 | showinfo "" "confirm" 393 | fi 394 | # -- 1Password.app -- 395 | if [ "$install1Password" = true ]; then 396 | showinfo "Installing 1Password:" "note" 397 | installApp1Password 398 | showinfo "" "confirm" 399 | fi 400 | # -- AlDente.app (only on portable Macs) -- 401 | if [ "$installAlDente" = true ] && checkIfMacIsPortable; then 402 | showinfo "Installing AlDente:" "note" 403 | installAppAlDente 404 | showinfo "" "confirm" 405 | fi 406 | # -- Beyond Compare -- 407 | if [ "$installBeyondCompare" = true ]; then 408 | showinfo "Installing Beyond Compare:" "note" 409 | installAppBeyondCompare 410 | showinfo "" "confirm" 411 | fi 412 | # -- Brave Browser -- 413 | if [ "$installBraveBrowser" = true ]; then 414 | showinfo "Installing Brave Browser:" "note" 415 | installAppBraveBrowser 416 | showinfo "" "confirm" 417 | fi 418 | # -- Discord.app -- 419 | if [ "$installDiscord" = true ]; then 420 | showinfo "Installing Discord:" "note" 421 | installAppDiscord 422 | showinfo "" "confirm" 423 | fi 424 | # -- eqMac.app -- 425 | if [ "$installEqMac" = true ]; then 426 | showinfo "Installing eqMac:" "note" 427 | installAppEqMac 428 | showinfo "" "confirm" 429 | fi 430 | # -- Figma.app -- 431 | if [ "$installFigma" = true ]; then 432 | showinfo "Installing Figma Desktop:" "note" 433 | installAppFigma 434 | showinfo "" "confirm" 435 | fi 436 | # -- Google Chrome.app -- 437 | if [ "$installGoogleChrome" = true ]; then 438 | showinfo "Installing Google Chrome Browser:" "note" 439 | installAppGoogleChrome 440 | showinfo "" "confirm" 441 | fi 442 | # -- GrandPerspective.app -- 443 | if [ "$installGrandPerspective" = true ]; then 444 | showinfo "Installing GrandPerspective:" "note" 445 | installAppGrandPerspective 446 | showinfo "" "confirm" 447 | fi 448 | # -- Heroic Games Launcher -- 449 | if [ "$installHeroicGamesLauncher" = true ]; then 450 | showinfo "Installing Heroic Games Launcher:" "note" 451 | installAppHeroicGamesLauncher 452 | showinfo "" "confirm" 453 | fi 454 | # -- LinearMouse.app -- 455 | if [ "$installLinearMouse" = true ]; then 456 | showinfo "Installing LinearMouse:" "note" 457 | installAppLinearMouse 458 | showinfo "Disabling Mouse cursor acceleration of macOS:" "note" 459 | disableMouseAcceleration 460 | showinfo "" "confirm" 461 | fi 462 | # -- Macs Fan Control.app -- 463 | if [ "$installMacsFanControl" = true ]; then 464 | showinfo "Installing Macs Fan Control:" "note" 465 | installAppMacsFanControl 466 | showinfo "" "confirm" 467 | fi 468 | # -- Microsoft Office / Office 365 for Mac -- 469 | if [ "$installMicrosoftOffice" = true ]; then 470 | showinfo "Installing Microsoft Office for Mac:" "note" 471 | installAppMicrosoftOffice 472 | showinfo "" "confirm" 473 | fi 474 | # -- Mozilla Firefox.app -- 475 | if [ "$installFirefox" = true ]; then 476 | showinfo "Installing Firefox Browser:" "note" 477 | installAppFirefox 478 | showinfo "" "confirm" 479 | fi 480 | # -- Nova.app -- 481 | if [ "$installNova" = true ]; then 482 | showinfo "Installing Nova App:" "note" 483 | installAppNova 484 | showinfo "" "confirm" 485 | fi 486 | # -- OverSight.app -- 487 | if [ "$installOverSight" = true ]; then 488 | showinfo "Installing OverSight:" "note" 489 | installAppOverSight 490 | showinfo "" "confirm" 491 | fi 492 | # -- Spotify.app -- 493 | if [ "$installSpotify" = true ]; then 494 | showinfo "Installing Spotify:" "note" 495 | installAppSpotify 496 | showinfo "" "confirm" 497 | fi 498 | # -- Steam -- 499 | if [ "$installSteam" = true ]; then 500 | showinfo "Installing Steam:" "note" 501 | installAppSteam 502 | showinfo "" "confirm" 503 | fi 504 | # -- Telegram.app -- 505 | if [ "$installTelegram" = true ]; then 506 | showinfo "Installing Telegram:" "note" 507 | installAppTelegram 508 | showinfo "" "confirm" 509 | fi 510 | # -- Transmission.app -- 511 | if [ "$installTransmission" = true ]; then 512 | showinfo "Installing Transmission:" "note" 513 | installAppTransmission 514 | showinfo "" "confirm" 515 | fi 516 | # -- Tresorit.app -- 517 | if [ "$installTresorit" = true ]; then 518 | showinfo "Installing Tresorit:" "note" 519 | installAppTresorit 520 | showinfo "" "confirm" 521 | fi 522 | # -- Visual Studio Code -- 523 | if [ "$installVisualStudioCode" = true ]; then 524 | showinfo "Installing Visual Studio Code:" "note" 525 | installAppVSCode 526 | showinfo "" "confirm" 527 | fi 528 | # -- VLC Media Player -- 529 | if [ "$installVLC" = true ]; then 530 | showinfo "Installing VLC Media Player:" "note" 531 | installAppVLC 532 | showinfo "" "confirm" 533 | fi 534 | # -- Warp -- 535 | if [ "$installWarp" = true ]; then 536 | showinfo "Installing Warp Terminal:" "note" 537 | installAppWarp 538 | showinfo "" "confirm" 539 | fi 540 | # -- Whisky -- 541 | if [ "$installWhisky" = true ]; then 542 | showinfo "Installing Whisky:" "note" 543 | installAppWhisky 544 | showinfo "" "confirm" 545 | fi 546 | # -- Xnapper.app -- 547 | if [ "$installXnapper" = true ]; then 548 | showinfo "Installing Xnapper:" "note" 549 | installAppXnapper 550 | showinfo "" "confirm" 551 | fi 552 | # -- Xcode Command Line Tools -- 553 | if [ "$installXcodeTools" = true ] || [ "$installHomebrew" = true ]; then 554 | # !! NOTE: Pre-requisite for Homebrew !! 555 | showinfo "Installing Xcode Command Line Tools (xcode):" "note" 556 | installAppXcodeCLT 557 | if checkIfXcodeInstalled; then 558 | showinfo "" "confirm" 559 | else 560 | showinfo "Xcode Command Line Tools were not installed" "error" 561 | fi 562 | fi 563 | # -- Homebrew -- 564 | if [ "$installHomebrew" = true ]; then 565 | showinfo "Installing Homebrew (brew):" "note" 566 | installAppHomebrew 567 | 568 | # Extend macOS Functionality with helpful Tools 569 | if checkIfHomebrewInstalled; then 570 | showinfo "" "confirm" 571 | 572 | # -- Install Apps via Homebrew -- 573 | showinfo "Installing GnuPG, OpenSSH, and wget:" "note" 574 | brewinstallAppGnuPG 575 | brewinstallAppOpenSSH 576 | brewinstallAppWget 577 | showinfo "" "confirm" 578 | 579 | # --> Syntax Highlight (Quick Look Extension) 580 | if [ "$installSyntaxHighlightQuickLook" = true ]; then 581 | showinfo "Installing Syntax Highlight Quick-Look plugin:" "note" 582 | brewinstallAppSyntaxHighlight 583 | showinfo "" "confirm" 584 | fi 585 | 586 | # -- Install Apps from App Store -- 587 | if [ "$installAppStoreApps" = true ]; then 588 | # --> Mac App Store CLI 589 | showinfo "Installing Mac App Store CLI (mas):" "note" 590 | brewinstallAppMacAppStoreCLI 591 | 592 | # Continue only when successfully authenticated in App Store 593 | if checkIfAppStoreAuthenticated; then 594 | showinfo "" "confirm" 595 | 596 | # --> App updates from App Store 597 | showinfo "Activating Auto-Updating Apps:" "note" 598 | masinstallAppUpdates 599 | showinfo "" "confirm" 600 | 601 | # --> AdGuard for Safari 602 | if [ "$installAdGuardSafari" = true ]; then 603 | masinstallAppAdGuardSafariExtension 604 | fi 605 | 606 | # --> 1Password for Safari 607 | if [ "$install1Password" = true ]; then 608 | masinstallApp1PasswordSafariExtension 609 | fi 610 | 611 | # --> Strongbox 612 | if [ "$installStrongbox" = true ]; then 613 | masinstallAppStrongbox 614 | fi 615 | 616 | # --> Pixelmator Pro 617 | if [ "$installPixelmator" = true ]; then 618 | masinstallAppPixelmator 619 | fi 620 | 621 | # Mac App Store CLI was NOT installed 622 | else 623 | showinfo "Not authenticated in Mac App Store!\n--> Mac App Store CLI (mas) not installed" "error" 624 | 625 | # --> AdGuard for Safari 626 | if [ "$installAdGuardSafari" = true ]; then 627 | showinfo "Install App manually from App Store: 'AdGuard for Safari'" "notice" 628 | fi 629 | 630 | # --> 1Password for Safari 631 | if [ "$install1Password" = true ]; then 632 | showinfo "Install App manually from App Store: '1Password for Safari'" "notice" 633 | fi 634 | 635 | # --> Strongbox 636 | if [ "$installStrongbox" = true ]; then 637 | showinfo "Install App manually from App Store: 'Strongbox Password Manager'" "notice" 638 | fi 639 | 640 | # --> Pixelmator Pro 641 | if [ "$installPixelmator" = true ]; then 642 | showinfo "Install App manually from App Store: 'Pixelmator Pro'" "notice" 643 | fi 644 | fi 645 | fi 646 | # END -- Mac App Store CLI -- 647 | else 648 | # Homebrew was NOT installed 649 | showinfo "Homebrew could not be installed" "error" 650 | fi 651 | fi 652 | # END -- Homebrew -- 653 | 654 | # -- Web Dev (install) -- 655 | if [ "$installWebdevTools" = true ]; then 656 | showinfo "Installing Web Development Tools:" "notice" 657 | 658 | # -- Git Command Line Tools -- 659 | # (Skipped if already installed through Xcode Command Line Tools) 660 | if [ "$installGit" = true ] && ! checkIfXcodeInstalled; then 661 | showinfo "Installing Git:" "note" 662 | brewinstallAppGit 663 | showinfo "" "confirm" 664 | else 665 | showinfo "Git is already installed" "confirm" 666 | fi 667 | 668 | # -- Composer -- 669 | if [ "$installComposer" = true ] && checkIfHomebrewInstalled; then 670 | # -- PHP -- 671 | # (pre-requisite for Composer) 672 | showinfo "Installing PHP:" "note" 673 | brewinstallAppPHP 674 | showinfo "" "confirm" 675 | 676 | showinfo "Installing Composer:" "note" 677 | brewinstallAppComposer 678 | showinfo "" "confirm" 679 | fi 680 | 681 | # -- Fork.app -- 682 | if [ "$installFork" = true ]; then 683 | showinfo "Installing Fork App:" "note" 684 | installAppFork 685 | showinfo "" "confirm" 686 | fi 687 | 688 | # -- Gas Mask.app -- 689 | if [ "$installGasMask" = true ]; then 690 | showinfo "Installing Gas Mask Hostfiles-Manager:" "note" 691 | installAppGasMask 692 | showinfo "" "confirm" 693 | fi 694 | 695 | # -- Sequel Ace.app -- 696 | if [ "$installSequelAce" = true ] && checkIfHomebrewInstalled; then 697 | showinfo "Installing Sequel Ace Database-Manager:" "note" 698 | brewinstallAppSequelAce 699 | showinfo "" "confirm" 700 | fi 701 | 702 | # -- Boop.app -- 703 | if [ "$installBoop" = true ] && checkIfHomebrewInstalled && 704 | checkIfAppStoreAuthenticated; then 705 | showinfo "Installing Boop App:" "note" 706 | masinstallAppBoop 707 | showinfo "" "confirm" 708 | fi 709 | 710 | if [ "$installMAMP" = false ] || [ ! "$installMAMP" ]; then 711 | # -- OrbStack (preferred over Docker) -- 712 | if [ "$useOrbStackOverDocker" = true ]; then 713 | showinfo "Installing OrbStack (Docker alternative):" "note" 714 | if [ checkIfHomebrewInstalled ]; then 715 | brewinstallAppOrbStack 716 | else 717 | installAppOrbStack 718 | fi 719 | showinfo "" "confirm" 720 | 721 | # -- SonarQube (for Docker) -- 722 | if [ "$installSonarQube" = true ] && [ checkIfHomebrewInstalled ]; then 723 | showinfo "Installing SonarQube for Docker:" "note" 724 | brewinstallAppSonarQube 725 | showinfo "" "confirm" 726 | fi 727 | # -- Docker for Mac -- 728 | elif [ "$installDocker" = true ] && checkIfHomebrewInstalled; then 729 | showinfo "Installing Docker for Mac:" "note" 730 | brewinstallAppDocker 731 | showinfo "" "confirm" 732 | 733 | # -- SonarQube (for Docker) -- 734 | if [ "$installSonarQube" = true ]; then 735 | showinfo "Installing SonarQube for Docker:" "note" 736 | brewinstallAppSonarQube 737 | showinfo "" "confirm" 738 | fi 739 | fi 740 | elif [ "$installMAMP" = true ]; then 741 | # -- MAMP Suite -- 742 | installAppMAMP 743 | fi 744 | fi 745 | # END -- Web Dev -- 746 | 747 | # -- Disabling Quarantine flags for new Applications -- 748 | if checkIfFileExists "$HOME/Applications"; then 749 | showinfo "Trying to clear new Apps from macOS Quarantine:" "note" 750 | disableAppQuarantine "$HOME/Applications" 751 | showinfo "" "confirm" 752 | fi 753 | 754 | # -- ENABLE macOS Gatekeepr (if disabled) -- 755 | if ! macosGatekeeper; then 756 | showinfo "ENABLING Gatekeeper to disallow unsiged Applications:" "note" 757 | macosGatekeeper "on" 758 | showinfo "" "confirm" 759 | fi 760 | 761 | 762 | 763 | # ------------------------------ 764 | # APP CONFIGURATIONS 765 | # ------------------------------ 766 | showinfo "APPLY APP CONFIGURATIONS" "shout" 767 | # -- Dock customizations -- 768 | if [ "$beautifyDock" = true ] && [ ! "$minimalDock" ]; then 769 | showinfo "Beautifying the Dock:" "note" 770 | source ./Usersettings/Dock.sh > /dev/null 771 | # --> Add divider to Dock 772 | addSpacerToDock 773 | # --> Add installed App Icons to Dock 774 | if [ "$installDiscord" = true ]; then 775 | addAppToDock "Discord" 776 | fi 777 | if [ "$installGoogleChrome" = true ]; then 778 | addAppToDock "Google Chrome" 779 | fi 780 | if [ "$installFirefox" = true ]; then 781 | addAppToDock "Firefox" 782 | fi 783 | if [ "$installGrandPerspective" = true ]; then 784 | addAppToDock "GrandPerspective" 785 | fi 786 | if [ "$installNova" = true ]; then 787 | addAppToDock "Nova" 788 | fi 789 | if [ "$installPixelmator" = true ]; then 790 | addAppToDock "Pixelmator Pro" 791 | fi 792 | if [ "$installSpotify" = true ]; then 793 | addAppToDock "Spotify" 794 | fi 795 | if [ "$installStrongbox" = true ]; then 796 | addAppToDock "Strongbox" 797 | fi 798 | if [ "$installTransmission" = true ]; then 799 | addAppToDock "Transmission" 800 | fi 801 | if [ "$installTelegram" = true ]; then 802 | addAppToDock "Telegram" 803 | fi 804 | if [ "$installTresorit" = true ]; then 805 | addAppToDock "Tresorit" 806 | fi 807 | if [ "$installVisualStudioCode" = true ]; then 808 | addAppToDock "Visual Studio Code" 809 | fi 810 | if [ "$installXnapper" = true ]; then 811 | addAppToDock "Xnapper" 812 | fi 813 | if [ "$installWebdevTools" = true ]; then 814 | addSpacerToDock 815 | if [ "$installBoop" = true ]; then 816 | addAppToDock "Boop" 817 | fi 818 | if [ "$installFork" = true ]; then 819 | addAppToDock "Fork" 820 | fi 821 | if [ "$installGasMask" = true ]; then 822 | addAppToDock "Gas Mask" 823 | fi 824 | if [ "$installSequelAce" = true ]; then 825 | addAppToDock "Sequel Ace" 826 | fi 827 | fi 828 | showinfo "" "confirm" 829 | fi 830 | 831 | # -- Set-up Git and SSH -- 832 | if [[ "$installWebdevTools" = true && "$installGit" = true ]] || 833 | checkIfXcodeInstalled; then 834 | # --> Git configs 835 | showinfo "Configuring Git:" "note" 836 | setGitconfigs 837 | showinfo "" "confirm" 838 | 839 | # --> SSH 840 | showinfo "Configuring an SSH Key to use with Git:" "note" 841 | generateSSHKey 842 | showinfo "" "confirm" 843 | fi 844 | 845 | # -- Terminal Configs -- 846 | if [ "$enableTerminalUtf8" = true ]; then 847 | showinfo "Enabling UTF-8 as default for the Terminal:" "note" 848 | enableTerminalUtf8 849 | showinfo "" "confirm" 850 | fi 851 | if [ "$useCustomTerminalTheme" = true ]; then 852 | showinfo "Installing custom Terminal Theme file:" "note" 853 | downloadTerminalCustomTheme 854 | showinfo "" "confirm" 855 | fi 856 | if [ "$useCustomTerminalConfigurations" = true ]; then 857 | showinfo "Adding custom Terminal commands to ~/.zshrc:" "note" 858 | downloadTerminalzshrcContents 859 | showinfo "" "confirm" 860 | fi 861 | 862 | 863 | 864 | # ------------------------------ 865 | # CUSTOM COMMANDS 866 | # 867 | # Executes custom commands from 868 | # mycommands.sh 869 | # ------------------------------ 870 | showinfo "APPLY CUSTOM COMMANDS" "shout" 871 | if checkIfFileExists "mycommands.sh" && [ -s mycommands.sh ]; then 872 | showinfo "Executing custom commands:" "note" 873 | bash mycommands.sh 874 | showinfo "(mycommands.sh)" "confirm" 875 | else 876 | showinfo "(not required)" "note" 877 | fi 878 | --------------------------------------------------------------------------------