Git Product home page Git Product logo

swiss-mac-user / macos-scripted-setup Goto Github PK

View Code? Open in Web Editor NEW
43.0 4.0 3.0 639 KB

A scripted macOS setup for automatic User configurations and App installations.

Home Page: https://swissmacuser.ch/macos-scripted-setup-automate-user-settings-app-installations/?utm_source=github&utm_medium=macOS-scripted-setup

License: MIT License

Shell 100.00%
bash dotfiles-macos macos macos-defaults macos-setup

macos-scripted-setup's Introduction

Automate your macOS setup

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.

Tip

The scripted setup was tested on Intel-based Macs & Apple Silicon Macs On macOS 12 Monterey up to macOS 14 Sonoma

What is this?

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!

Screenshot of macOS Scripted Setup in action

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.

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.

What is being done exactly?

See what features, settings, and applications can be changed / installed

The script can change the following settings:

  • FileVault, macOS Firewall, Mission Control, Control Centre, Finder, Dock, git, SSH Key, adds Userhome folders, Menu bar clock, Fast User Switching, and more.

…and is capable of installing these Apps:

Some Apps are downloaded from the official websites, other are added through Homebrew or its Mac App Store CLI extension.

  • 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.

How to use

📥 Download macOS Scripted Setup

Automatic download with this command in the Terminal.app from Applications » Utilities:

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"

→ Alternatively you can manually download & extract the latest «Source code (zip)» from Releases to your ~/Downloads/ folder.

⚙️ Configure your preferences

  1. Duplicate the file config.default.sh as config.sh

  2. Open config.sh in a Text editor (e.g. TextEdit.app)

  3. …and change all settings to your personal preferences, using true/false.

Warning

If no config.sh-file is present, the setup will use the default configs from config.default.sh!

Advanced settings

Configuring custom bash commands to run

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).

🚀 Start the scripted Setup

Maybe now is the time to grab a coffee ☕️

  1. Open the «Terminal.app» from Applications » Utilities

  2. Paste the following command to the Terminal.app:

cd ~/Downloads/macOS-scripted-setup-installer/ && chmod +x ./run.sh && ./run.sh
  1. Now start the setup by pressing Return & watch the magic happen…

Tip

Occasionally you have to interact when instructions show up, such as to sign-in on the Mac App Store.

✨ That's it - happy installation! :)

Requests for changes

Issues and feature requests

Report an Issue or start a new Discussion for feedback or help.

Contributions

Feel free to fork this project and add Pull Requests for any suggested changes or additions!


Support this project with a Coffee.

Inspiration and Kudos

A BIG «THANK YOU» to these inspiring and helfpful sources! 🫶 Make sure to check them out and leave a kudos.

macos-scripted-setup's People

Contributors

swiss-mac-user avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

macos-scripted-setup's Issues

[Known issue] `mas` (Mac App Store CLI) not installing Apps in macOS 12+

The Homebrew extension mas (Mac App Store command line interface), for automatic Apps install from the Mac App Store, won't recognize a successful App Store-authentication during setup.

Reason is the known issue and lacking support by the mas library itself, as tracked in the issue here:

Workaround

Note that mas will be successfully installed (if enabled), and hence can later be used in the Terminal to manually install Apps from the Mac App Store.

[Known issue] «App is damaged and can’t be opened» error when opening downloaded Apps

Some Applications downloaded by the script and using curl will, when trying to be (automatically) be opened, show the warning:

«App is damaged and can’t be opened. You should move it to the bin.»

image

Root cause

macOS security (Gatekeeper) quarantines some Apps, in order to attempt to limit software to the Mac App Store - plus System Integrity Protection is preventing third-party apps from potentially tampering with sensitive parts of the system or injecting code into Apple apps like Finder and Safari.

Unfortunately, at least since macOS 13 Ventura (which tightens security and previous workarounds), my tests were all unsuccessful to programmatically remove the affected Apps out of the Gatekeeper quarantine: I tried removing xattr-attributes, temporarily disabling spctl, and assigning missing xattr-attributes about the downloaded datetime and source.

Hence I see this currently as a won't fix - unless someone finds a clever way how this protection could be circumvented.

Workaround

As the apps are downloaded via their official website, it's unlikely – but not guaranteed – they are expected to be non-malicious and a so called "false positive".

The Apps can be opened using the following manual steps:

  1. Right-click the Application and choose "Open"
  2. Confirm the additional warning shown

Affected applications

Affected applications are:

  • Keka
  • Transmission
  • Nova
  • (non conclusive)

Not affected Apps seem to be:

  • 1Password Installer
  • Spotify Installer
  • Gas Mask
  • (non conclusive)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.