Skip to content

Instantly share code, notes, and snippets.

@fgimian
Last active June 16, 2016 22:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fgimian/758c549e1858a2038ada to your computer and use it in GitHub Desktop.
Save fgimian/758c549e1858a2038ada to your computer and use it in GitHub Desktop.
Setting up the Terminal with JavaScript on OS X Yosemite
#!/usr/bin/env osascript -l JavaScript
function run(argv) {
// Obtain the terminal application
terminal = Application('Terminal');
// Set the font
terminal.defaultSettings.fontName = 'Source Code Pro for Powerline';
terminal.defaultSettings.fontSize = 18;
terminal.defaultSettings.fontAntialiasing = true;
// Set the window size
terminal.defaultSettings.numberOfRows = 26;
terminal.defaultSettings.numberOfColumns = 130;
// Set the background color
terminal.defaultSettings.backgroundColor = {red: 0.1, green: 0.1, blue: 0.1};
}
@cbracco
Copy link

cbracco commented Mar 24, 2016

@fgimian how did you find out the names of those settings (ie. fontName, fontSize, etc)? I am trying to figure out how to set the line-height as well from this script.

@fgimian
Copy link
Author

fgimian commented Jun 16, 2016

@cbracco: I'm really sorry I never got a notification about your reply. You'll need to use the Script Editor and look through the API documentation there unfortunately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment