Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

While I'm sure I need to use defaults write com.apple.Terminal to do this, I'm not sure how to use a terminal theme file like IR_Black.terminal and set it to the default theme for a user.

Basically, I'd like to be able to do something like defaults write com.apple.Terminal Default Window Setting IR_Black.terminal

anyone know how to do this?

share|improve this question

migrated from stackoverflow.com Jul 21 '11 at 18:51

This question came from our site for professional and enthusiast programmers.

up vote 6 down vote accepted

Just configure your window the way you want it and then choose the Shell->Use Settings as Default command. There's no need to do anything from the command line.

From your comment, I understand that you want to be able to set the preferences for Terminal from a script as part of configuring a machine automatically. The easiest way to do that is probably to configure Terminal the way you want, and then make a copy of

/Users/*yourname*/Library/Preferences/com.apple.Terminal.plist

If you then copy that file to the target machine's

/Library/Preferences/com.apple.Terminal.plist

it'll become the default Terminal preferences for every user on that machine. Or, you can copy it to:

/Users/*username*/Library/Preferences/com.apple.Terminal.plist

to set the Terminal preferences just for user username.

You probably already know at least some of this. I know this answer skirts the question of how to do the equivalent thing with the defaults command, but if you do:

% defaults read com.apple.Terminal

you'll see that the value for the "Window Settings" key is a fairly complex dictionary that's going to be difficult to manipulate with defaults. I think it'll be much safer to let Terminal write the settings, and for you to simply copy the entire settings file.

share|improve this answer
    
Caleb - I'm deploying environments to multiple users. I can't rely on them to do this on their own (don't get me started on why) – Cory Collier Jul 21 '11 at 14:56
    
@CoryCollier: Edited my answer to help (I hope) with your situation. Good luck. – Caleb Jul 21 '11 at 22:16

I understand I am late to this question but I just solved a similar issue myself. Here was what I did:

  1. Export the style from the plist by running:

    $ /usr/libexec/PlistBuddy -x ~/Library/Preferences/com.apple.Terminal.plist -c 'print ":Window Settings:SETTINGNAME"' > SETTINGNAME.plist
    
  2. Copy the plist to another machine
  3. On the other machine, run:

    $ /usr/libexec/PlistBuddy ~/Library/Preferences/com.apple.Terminal.plist -c 'add ":Window Settings:SETTINGNAME" dict'
    $ /usr/libexec/PlistBuddy ~/Library/Preferences/com.apple.Terminal.plist -c 'merge SETTINGNAME.plist ":Window Settings:SETTINGNAME"'
    

Then you can set the default color scheme with defaults.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .