The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

new-iterm - open a new iTerm window with one or more tabs

SYNOPSIS

        ---Frontmost finder directory, defaulting to desktop
        % new-iterm

        ---Frontmost finder directory, using special alias
        % new-iterm finder
        
        ---Named directory
        % new-iterm /Users/brian/Dev

        ---Named directory with
        % new-iterm ~/Dev
        
        ---Multiple tabs 
        % new-iterm ~/Dev ~/Foo ~/Bar
        
        ---Aliases, predefined in code
        % new-iterm music applications
        
        ---Aliases, defined in your own ~/.new-iterm-aliases
        % new-iterm foo bar baz
        
        ---Any combination
        % new-iterm finder /Users/brian/Dev music ~/Pictures foo
        
        ---From other commands
        % perldoc -l Mac::Glue | xargs dirname | xargs new-iterm
        

DESCRIPTION

This script opens a new iTerm window and creates a tab for each directory. Within each tab, it changes to that directory. It allows you to use aliases (not the filesystem sort, the nickname sort) to save on typing. Without arguments it finds the frontmost finder window and uses that as the directory. The special directory named "finder" does the same thing (so you're stuck if you have a directory with that name: give it a different alias).

Modulino

This script is actually a modulino. It's a symlink to the Mac::iTerm::LaunchPad module. That module figures out if it's run as a script or included as a module and does the right thing. If you want to change the program, edit the module.

If you don't like that idea, use the included scripts/new-iterm program which does the same thing without the symlink.

Aliases

You can define aliases in the ~/.new-iterm-aliases file. The file is line-oriented and has the alias followed by its directory. You can use the ~ home directory shortcut.

        #alias  directory
        cpan /mirrors/MINICPAN
        dev     ~/Dev
        paypal ~/Personal/Finances/PayPal
        

Since Mac OS X uses a case insenstive (though preserving) file system, case doesn't matter. If you tricked Mac OS X into using something else, use the right case and remove the lc() in the code.

Default aliases

desktop - the Desktop folder of the current user ( ~/Desktop )
home - home directory of the current user ( ~ )
music - music directory of the current user ( ~/Music )
applications - music directory of the current user ( ~/Applications )
finder - the directory of the frontmost finder window (defaults to Desktop)

TO DO

switch to choose session name (currently just default)
switch to specify tabs or new windows?

AUTHOR

brian d foy, <bdfoy@cpan.org>

Inspired by a script from Chris Nandor (http://use.perl.org/~pudge/journal/32199) which was inspired by a script from Curtis "Ovid" Poe (http://use.perl.org/~Ovid/journal/32086).

COPYRIGHT AND LICENSE

Copyright 2007, brian d foy.

You may use this program under the same terms as Perl itself.

Some parts come from Chris Nandor and are noted in the source. They are available under the same license.

SEE ALSO

iTerm - http://iterm.sourceforge.net/