Is there a command line utility / script to add a profile to iterm2?

681 views
Skip to first unread message

Karl

unread,
Mar 19, 2013, 9:52:58 AM3/19/13
to iterm2-...@googlegroups.com

I am trying to add profiles programmatically  via the command line.  I have like 900 plus hosts to configure, and creating a profile by hand is going to be a little tedious.   

Any one have any good ideas?  I know they are stored under the bookmarks, and they can be translated to and from xml. 

Thank you

Karl

George Nachman

unread,
Mar 19, 2013, 2:26:07 PM3/19/13
to iterm2-...@googlegroups.com
Wow, that is a lot of hosts. There is a scripting interface planned but the work hasn't started yet; I would definitely go the XML route on this. It shouldn't be too hard to do; I'm guessing you just need to customize one or two fields per host. The "New Bookmarks" key contains an array which has a dict for each profile.

You probably know this already, but you can convert the plist to xml with this command (but make a copy first because the one in Library/Preferences is constantly being overwritten):
plutil -convert xml1 com.googlecode.iterm2.plist

Once you have them all imported, it's easy to make changes to hundreds of profiles at once with "prefs>profiles>other actions>bulk copy from selected profile…".


Karl

--
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.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Trevor Fong

unread,
Oct 23, 2014, 2:15:20 PM10/23/14
to iterm2-...@googlegroups.com, gnac...@llamas.org
Hi There,

I also need to do this.  I noticed though that each dict in the array contains a unique GUID.  Would there be problems if each of my new servers have the same GUID?

Thanks,
Trev

George Nachman

unread,
Oct 23, 2014, 3:51:39 PM10/23/14
to Trevor Fong, iterm2-...@googlegroups.com
I'm glad this thread was revived because there's a much better solution now.


Unique IDs to need to be unique, but you can probably just use the remote hostname as the unique ID. Note this only works on the 2.9 branch, available in the nightly builds.

Kevin McCall

unread,
Jun 18, 2015, 12:47:47 PM6/18/15
to iterm2-...@googlegroups.com, tjf...@gmail.com, gnac...@llamas.org
When will this version, or more specifically this feature, be promoted to the stable version?

This thread about 2.9 is pretty old and the latest stable version is still only 2.1.1

George Nachman

unread,
Jun 18, 2015, 12:50:07 PM6/18/15
to iterm2-...@googlegroups.com, tjf...@gmail.com, George Nachman
2.9 is about to enter beta. I'm adding some minor stuff before that happens, but I wouldn't hesitate to switch over now. It's very stable, and has a lot of bug fixes 2.1.1 does not have. The only reason to delay is that applescript is not backward compatible, but it's not hard to fix either (the new syntax is at https://iterm2.com/applescript.html).

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages