Home > Management Profiles, Scripting > Deploying Terminal profile settings using macOS configuration profiles

Deploying Terminal profile settings using macOS configuration profiles

A number of Mac admins have their Terminal appearance settings configured just the way they like them, but it can be a bit of manual work to export and import them. After having to manually configure and export these settings more than a few times, I wanted to see if it was possible to export these settings in a way to make it easy to convert into a configuration profile.

With a little work and research, I was able to write a script which handled exporting the Terminal profile I wanted into a properly formatted plist file. For more details, please see below the jump.

The script I wrote is named Export_Mac_Terminal_Profiles and it is a .command file, which means it can be run by double-clicking on it. To use it, please use the following procedure:

  1. Identify the name of the Terminal profile you want to export.
  2. Double-click on the Export_Mac_Terminal_Profiles.command script.
  3. Enter the name of the Terminal profile you want to export.
  4. Decide if you want the exported Terminal profile to be set up as a default profile. By specifying it as a default profile, the exported Terminal profile will be configured as both a startup profile and as a default profile.

In this example, I’ve configured a custom Terminal profile named Documentation in my account’s Terminal settings and want to export it for use with a configuration profile.

Screen Shot 2019 12 18 at 4 47 23 PM

To export it, I followed the procedure described above and entered the following when prompted:

Name: Documentation
Default profile: 1 (which configures the exported profile to be set as both a startup profile and as a default profile.)

Screen Shot 2019 12 18 at 6 16 55 PM

When the script finished running, it opened a Finder window showing me a com.apple.Terminal.plist file.

Screen Shot 2019 12 18 at 6 16 35 PM

This plist file contained all of the settings needed to create a configuration profile which did the following:

  1. Install the Documentation Terminal profile
  2. Configure the Documentation Terminal profile as both a startup profile and as a default profile.

From there, I used Tim Sutton‘s mcxToProfile tool to create a configuration profile from the exported com.apple.Terminal.plist file.

Screen Shot 2019 12 18 at 6 25 47 PM

Once I had the configuration profile, I verified that I was able to install it and that the Documentation Terminal profile was now installed and set as the default profile.

Screen Shot 2019 12 18 at 5 10 07 PM

However, one side effect I noticed was that installing a Terminal profile using a configuration profile resulted in all other Terminal profiles vanishing from the Terminal preferences.

Screen Shot 2019 12 18 at 4 42 25 PM

To restore copies of the OS-provided Terminal profiles, click on the Profiles window’s cog wheel and select Restore Default Profiles.

Screen Shot 2019 12 18 at 4 44 49 PM

This will restore the OS-installed Terminal profiles in their default configuration. This restore process will not affect the Terminal profile installed by the configuration profile.

Screen Shot 2019 12 18 at 4 47 23 PM

The Export_Mac_Terminal_Profiles script is available below and also on GitHub at the following address:

https://github.com/rtrouton/rtrouton_scripts/tree/master/rtrouton_scripts/Export_Mac_Terminal_Profiles

The example configuration profile for the Documentation Terminal profile is also available below.

  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: