Fixed it (again)

A sort of follow-up to ‘Fixed it’ – Minor adjustments to the script I propably use the most. I now use iTerm2.app.

The script provides me with the following features:

#gives me a list of terminal profiles
% it list
#open a new iTerm session with the specified profile
% it <profile>
  1. #!/bin/bash
  2. #http://mkaz.com/ref/macosx/iterm.html
  3. #http://www.macosxhints.com/article.php?story=20070409141256538
  4. arg=$1;
  5. if [[$#” = “0” ]]; then
  6. echo “Usage: ‘it bookmarkname’ or ‘it list’” && exit 1
  7. elif [[ “$1” = “list” ]]; then
  8. defaults read ~/Library/Preferences/com.googlecode.iterm2|grep -e ‘\bName =‘|awk{$1=“”;$2=“”; print $0}|tr -d ‘;’
  9. else
  10. osascript <<ENDSCRIPT
  11. on run argv
  12.   tell application “iTerm”
  13.   activate
  14.   tell the current terminal
  15.   launch session “$1”
  16.   end tell
  17.   end tell
  18. end run
  19. ENDSCRIPT
  20. fi

I wonder if it should default to the default profile, so no arguments would just open a default terminal?

Leave a comment

0 Comments.

Leave a Reply


[ Ctrl + Enter ]