Pregunta

I am trying to do the following

disable Iterm2 settings like "Draw bold text in bold font" from COMMAND line, I know it is easy to disable with few mouse clicks, because I am using Boxen to setup my Mac, just want to be able to get some application settings sorted as well.

I run following command to verify the settings first

defaults read com.googlecode.iterm2 | grep -i bold

it returns

"Bold Color" =             {
        "Use Bold Font" = 1;
        "Use Bright Bold" = 1;

That looks good and when I try to modify it, following command did not work, it created another key.

defaults write com.googlecode.iterm2 '{ "Use Bold Font" = 0;}'

defaults read com.googlecode.iterm2 | grep -i bold
        "Bold Color" =             {
        "Use Bold Font" = 1;
        "Use Bright Bold" = 1;
"Use Bold Font" = 0;

so looks like "Use Bold Font" is a subkey or one level deep, I am not sure how to modify it.

any suggestions?

¿Fue útil?

Solución

Did some research and found answer myself, post it here just to share with others

"Use Bold Font" is part of a dictionary, and we need to use plistbuddy to change it, here is the command to see the current settings

[admin@mb-125:~] : /usr/libexec/PlistBuddy -c 'Print :"New Bookmarks":0:"Use Bold Font"' ~/Library/Preferences/com.googlecode.iterm2.plist
true

And this is how you change it from command line

[admin@mb-125:~] : /usr/libexec/PlistBuddy -c 'Set :"New Bookmarks":0:"Use Bold Font" false' ~/Library/Preferences/com.googlecode.iterm2.plist

Check again

[admin@mb-125:~] : /usr/libexec/PlistBuddy -c 'Print :"New Bookmarks":0:"Use Bold Font"' ~/Library/Preferences/com.googlecode.iterm2.plist
false

So basically you should be able to change all the settings from command line.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top