-1

I would like to get the list of available Terminal themes, i.e. Basic, Grass, Ocean etc., using a bash script.

Santanu Karar
  • 1,034
  • 1
  • 12
  • 27
  • Those items are key names in the Terminal preferences, which is a binary property list file. I see an `osascript` tag, but that doesn’t use bash - what kind of script are you looking for? – red_menace Nov 05 '22 at 04:31
  • Any `osascript` or Terminal command that retrieves the list - would be helpful. – Santanu Karar Nov 07 '22 at 04:49

1 Answers1

0

So far, the only option I found with following command run:

defaults read com.apple.Terminal "Window Settings"

This will returns all the available Terminal theme with their respective details in NeXTSTEP format. Example,

Basic =     {
        Font = {length = 266, bytes = 0x62706c69 73743030 d4010203 04050607 ... 00000000 000000ce };
        FontAntialias = 1;
        FontWidthSpacing = "1.004032258064516";
        ProfileCurrentVersion = "2.07";
        name = Basic;
        type = "Window Settings";
    };

However, I didn't found a way to convert the format in JSON easily except using "plutil". Unfortunately, "plutil" seems not available pre-installed in macOS.

Santanu Karar
  • 1,034
  • 1
  • 12
  • 27
  • An AppleScriptObjC script will also do that. Is JSON for the window settings what you are wanting now, or just the names? – red_menace Nov 08 '22 at 20:34