At home I've got a nice big display that unfortunately does not have the same resolution as my retina macbook does.
I'd like to use a pixel-font on the low-res screen and a nice smooth one on the retina screen. To do this I've set up a script that listens to an event when the display is connected.
I've set up two profiles in Terminal.app, one for the low-res screen and one for the retina screen.
Is there a way to make a profile the "default" profile (eg using applescript) without restarting Terminal.app (otherwise defaults com.apple.terminal ...
would have done it)
The following script works by changing the current default profile (so it's not entirely what I need, but might work if I find the names of all the settings I want to change):
#!/usr/bin/env osascript -l JavaScript
function run (argv) {
var terminal = Application('Terminal');
terminal.defaultSettings.fontName = 'creep';
terminal.defaultSettings.fontSize = 16;
// these don't seem to work
// because I do not know their names, and it's hard to debug guessing them
// terminal.defaultSettings.fontAntialiasing = false;
// terminal.defaultSettings.fontHeigthSpacing = 0.8;
}
I'd have to write a script to revert the changes
IOUSBDevice
however. Alternatively, you can just run a script that checks if the display is connected every 2 seconds or so (eg. usingioreg -p IODisplayConnect
).