Dotfiles unattended install

129 views
Skip to first unread message

Cosme Fulano

unread,
May 22, 2021, 9:10:53 AM5/22/21
to iterm2-discuss
Hey! I'm such a big fan of iterm2!!

I saw another post talking about unattended installation. Despite it looks very good, it lacks of configuring iTerm to the user needs.

I do have a github repo with my own dotfiles, including the terminal emulator settings. I just want to know where the option "General -> Preferences -> load preferences from a custom folder or URL" is written to, to link it to my backup automatically during the dotfiles installation.

Thanks in advance!
Sebastian

George Nachman

unread,
May 25, 2021, 11:36:02 PM5/25/21
to iterm2-...@googlegroups.com
The folder itself is under the user default named PrefsCustomFolder while the flag to enable loading from a custom location is LoadPrefsFromCustomFolder. Example commands:

defaults write com.googlecode.iterm2 LoadPrefsFromCustomFolder -bool true
defaults write com.googlecode.iterm2 PrefsCustomFolder /path/to/folder/containing/your/plist


--
You received this message because you are subscribed to the Google Groups "iterm2-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to iterm2-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/iterm2-discuss/b913f100-7512-4e9c-aa9b-18ced86886a6n%40googlegroups.com.

Michiel Van Couwenberghe

unread,
Sep 11, 2021, 4:27:39 PM9/11/21
to iterm2-discuss
Stumbled across this thread looking for something similar. Is there a way to initialize com.googlecode.iterm2 from a script? As far as I understand this is initialized from the moment you open iTerm2 for the first time. Basically I want to install iTerm2 from a script (e.g. using homebrew), initialize com.googlecode.iterm2.plist and set my custom preferences using the "defaults" command after that.

TJ Luoma

unread,
Sep 11, 2021, 10:21:51 PM9/11/21
to iterm2-...@googlegroups.com


On Sat, Sep 11, 2021 at 4:27 PM Michiel Van Couwenberghe <michielvanc...@gmail.com> wrote:

Is there a way to initialize com.googlecode.iterm2 from a script? As far as I understand this is initialized from the moment you open iTerm2 for the first time. Basically I want to install iTerm2 from a script (e.g. using homebrew), initialize com.googlecode.iterm2.plist and set my custom preferences using the "defaults" command after that.

The easiest way to do this is to get iTerm setup the way you like it, then quit the app and export the settings like so

defaults export com.googlecode.iterm2 ~/Desktop/iterm.plist

then transfer the resulting file to the target machine and enter this:

defaults import com.googlecode.iterm2 ~/Desktop/iterm.plist

Obviously you can change the “ ~/Desktop/iterm.plist” to whatever you want. 

Tj

Ps - I haven’t done this with iTerm, but I do it with BBEdit and I assume it works the same way.



Aaron Meurer

unread,
Sep 12, 2021, 10:01:09 PM9/12/21
to iterm2-...@googlegroups.com
People in this thread might also be interested in a tool I wrote
called prefsync, which lets you lets you sync plist files in a way
that is friendly to git repositories
https://www.asmeurer.com/prefsync/ (it's basically just a wrapper
around the plutil function that converts plist to xml, and some
launchd agents to bidirectionally sync them).

I'm not sure how much iTerm2's own json import/export features obviate
this. I don't personally use prefsync for iTerm2 but I have used it
for other programs.

Aaron Meurer
> --
> You received this message because you are subscribed to the Google Groups "iterm2-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to iterm2-discus...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/iterm2-discuss/CADjGqHvxabdDD8nQK80fVAT4iALLc3XofO%2B6JhKn0221kwyxrQ%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages