One thing that’s always bothered me about MacOS X’s Terminal.app is that you
can’t really run multiple applications. Technically you can but it’s not right
having to switch to Terminal and then cycle through the windows to get to the
one you want.
And I'm not talking about being able to have multiple shells running so keep
your iTerm has tabs
bullshit to yourself. I use
GNU/Screen for that and am quite happy
with it.
There’s a handful of textmode tools I'd like to be able to run as if they were all out Mac applications like Mutt, irssi, elinks, and Vim.
Some of the more popular textmode tools have graphical versions. Mac Vim is solid. AquaEmacs was a little wonky the last time I played with it. MacIrssi sucks because you can’t use plugins and, really, what’s the point of using a shitty textmode anything if you can’t customize the piss out of it?
We need Terminal.app to be a generic container for all of the textmode tools
we'd like to pull up to first-class application land. The good news is that,
after reading this article, you'll be able to do just that. The bad news is that
it requires quite a bit of work and the technique is pretty nasty. I would even
go so far as to call it a big giant hack.
To illustrate, we're going to turn top into a standalone application:
Top.app. Yes, even a tool as humble as top ought to have its own bouncy Dock
icon and Command+Tab target. We'll use it as a backup for Activity Monitor
the next time it goes all beach-ball on us.
We need another .app
The first thing I don’t like about this approach is that you have to copy
Terminal.app in its entirety. I recommend the Applications directory
under your $HOME:
$ mkdir -p ~/Applications # this may already exists
$ cp -r /Applications/Utilities/Terminal.app ~/Applications/Top.app
Without doing anything else, you can run Top.app and get a separate item in
The Dock and Command+Tab.
Open it from Finder, or:
$ open ~/Applications/Top.app
Changing The Menu
The menu still says “Terminal”, which is kind of annoying. We can change
this without too much hassle by editing the InfoPlist.strings file under your
locale’s directory. Check this out:
$ cd ~/Applications/Top.app/Contents/Resources/English.lproj
$ cat InfoPlist.strings
"CFBundleHelpBookName" = "Terminal Help";
"CFBundleName" = "Terminal";
"NSHumanReadableCopyright" = "? Copyright 1995-2003 Apple Compute ...
We need to open the InfoPlist.strings file in an editor that’s UTF-16 aware and change
the CFBundleName value from “Terminal” to “Top”. Vim worked swimmingly for
this task and OmniOutliner actually has a special graphical mode for strings
files. But you can open it in TextEdit if neither of those is available to you:
$ open -a TextEdit InfoPlist.strings
Once saved, you can quit and start Top.app again and you should now see
“Top” in the menu instead of Terminal.
Changing The Icon
The hard part about this step is finding an .icns file for the tool you're
running. top is the command-line equivalent of Activity Monitor, so let’s
just grab the icon from there:
$ cd ~/Applications/Top.app/Contents/Resources
$ cp icon.icns{,.orig} # backup original icons file
$ AM=/Applications/Utilities/Activity\ Monitor.app
$ cp "$AM/Contents/Resources/ActivityMonitor.icns" icon.icns
Note that the new icon won’t show up until you restart Finder. In most tutorials, this is where you logoff and back on. Fuck that:
$ killall Finder
TIP: If you have Apple’s Developer Tools installed, you can find
more icns files in the wilderness that is /Developer/Applications.
Customization
Now comes the sickest part of the hack.
We're presented with a bit of a dilemma. We want our Top.app window to be
fully customized and we also need a specific command to be executed
(/usr/bin/top). That’s not the problem – Terminal.app stores these types
of customization in .term files, which are easily created by opening a
terminal, customizing it using the inspector (Command+I), and then saving it
(File -> Save As or Command+Shift+S). When you save the .term file
there’s an option labeled, Open this file when Terminal starts up and this
is the problem: the setting applies to all Terminal applications (even
copies) because the default .term file is set as a user global preference in
~/Library/Preferences/com.apple.Terminal.plist. So, if we open Top.app as
is, customize it, save it and check that box, we'll end up loading the
Top.term file when any terminal is launched.
But it’s okay because Mac applications turn out to be extremely hackable. On most systems, you'd be getting out your hex editor and patching binaries. But not here – changing the preference property list used by an application turns out to be trivial:
$ cd ~/Applications/Top.app/Contents/
$ grep -A1 CFBundleId Info.plist
<key>CFBundleIdentifier</key>
<string>com.apple.Terminal</string>
See that? Rock! All we need to do is change com.apple.Terminal to something else, like
com.rtomayko.Top. You can open the file in the nice little Property List Editor.app and
change the CFBundleIdentifier property or you can start using your machine as God intended:
$ perl -pi.orig -e 's/com\.apple\.Terminal/com.rtomayko.Top/'
$ grep -A1 CFBundleId Info.plist
<key>CFBundleIdentifier</key>
<string>com.rtomayko.Top</string>
It’s smooth sailing from here on out. Open Top.app and you should get a little white terminal
window. Run top -s1 -ocpu at the prompt so we can get a feel for how the window should be
dimensioned. Bump the font size up about 5 times using Command + and then resize the window so
that the top output fits just right.
Next, hit Command+I to get into the inspector, and customize it as you see fit. Here
are the settings I used for each of the customization areas:
- Shell – When the shell exits, close the window.
- Processes – Prompt before closing window: never.
- Buffer – Buffer Size: Disabled (there’s no need for a scrollback buffer in cursors apps).
- Display – Text: Bitstream Vera Sans Mono, Anti-aliasing, Disable Blinking Text.
- Color – Green on Black, Transparency.
- Window – Title: “Top”, disable everything else.
Now, hit Command+S to save the .term file. You get a normal Save As dialog with a few
extra options. Enter “Top” in the Save As box, you want to save the Main Window, you want to
open this file when Terminal starts up, and you want to execute the following command:
exec /usr/bin/top -s1 -ocpu
You also want to check the Execute command in a shell box (it’s the only way I've found that let’s you pass arguments).
Save it and Quit. If everything went right, you should be right back where you left the next
time you open Top.app.
Lather, Rinse, Repeat
To sum up, the basic steps are as follows:
- Copy
Terminal.apptoFoo.app. - Edit
Locale.lproj/InfoPlist.stringsfor the menu andInfo.plistfor the preference. - Overwrite
icon.icnswith a distinct.icnsfile. - Open
Foo.app, customize, save.termfile as Default.
Issues / Ideas
This approach has drawbacks and limitations:
It’s not correct.
Terminal.appshould provide a mechanism for achieving these results without all the hackery.Updates to
Terminal.appwill not automatically be picked up. It may be necessary to go through the process after an update.I have not been able to figure out if it’s possible to open files or pass arguments to these applications otherwise.
I'm considering throwing together a quick shell script that’s capable of
performing the nitty gritty aspects given a directory containing a few files:
the .icns file and maybe some kind of simple config file that contains the
values needed for the Info.plist.




Discuss
Is it possible to do something like this with AppleScript/Automator? I'm away from my Mac, so I have no idea what AppleScript commands Terminal.app supports, and it may be impossible after all. I would feel better if this “cleaner” approach were analyzed.
— Joseph Oswald on Wednesday, October 25, 2006 at 12:16 PM #
Something similar can be done with AppleScript. Since I don’t speak AppleScript I use RubyOSA instead – the following should start a new terminal with the “top” command:
— Anders on Wednesday, January 03, 2007 at 09:18 AM #
I have the same problem with X11. Although a desktop or window manager should be a solution, every time I've tried that it’s failed miserably. The problem is, with e.g. 15 X11 windows open, one crash kills them all, and I find it happens all the time. Thanks for the term tips though.
— Adam on Thursday, May 31, 2007 at 11:59 AM #
Has OSX 10.5 Terminal.app made this any easier? For instance can terminal.app take arguments yet?
— hessml on Tuesday, December 11, 2007 at 03:50 PM #
I'm still running 10.4 so I'm not sure.
— Ryan Tomayko on Tuesday, March 11, 2008 at 01:35 AM #
cool site thanks
— peeing teens on Friday, May 30, 2008 at 05:59 PM #
great work man 10x
— teen pregnancy on Friday, May 30, 2008 at 05:59 PM #
sweet site dude )) i love u
— hot nude teens on Saturday, May 31, 2008 at 12:45 AM #
Visit this link please,
— Pdgxubmt on Tuesday, June 17, 2008 at 08:28 AM #
Visit this link please,
— Vnqtawqj on Wednesday, June 25, 2008 at 03:08 PM #
Preved webmastero4ki,
— Lthvxknd on Wednesday, June 25, 2008 at 07:12 PM #
Preved webmastero4ki,
— Lthvxknd on Wednesday, June 25, 2008 at 07:12 PM #
Preved webmastero4ki,
— Lthvxknd on Wednesday, June 25, 2008 at 07:13 PM #
Nice stuff,
— Igfowbyh on Wednesday, June 25, 2008 at 08:12 PM #
Preved webmastero4ki,
— Wkfsyrop on Thursday, June 26, 2008 at 02:37 PM #
Sorry,
— Zkppqnpk on Thursday, June 26, 2008 at 04:50 PM #
Visit this link please,
— Ecabsdjo on Thursday, June 26, 2008 at 10:49 PM #
Sorry,
— Zkbrocrl on Friday, June 27, 2008 at 12:11 AM #
Nice stuff,
— Xcctscso on Sunday, June 29, 2008 at 12:12 AM #
Visit this link please,
— Uhbsbhfy on Wednesday, July 02, 2008 at 03:14 PM #
Visit this link please,
— Lxrnmdwj on Wednesday, July 02, 2008 at 04:43 PM #
Sorry,
— Hswthkcr on Wednesday, July 02, 2008 at 06:09 PM #
Visit this link please,
— Hduhyndm on Sunday, July 13, 2008 at 08:16 AM #
Preved webmastero4ki,
— Muombdto on Tuesday, July 15, 2008 at 04:30 PM #
This is a best site,
— Hlwbpvha on Tuesday, July 15, 2008 at 06:52 PM #
many porn videos every day. Sex videos can be viewed online or downloaded completely free. Huge selection of hardcore videos
— tube on Thursday, July 17, 2008 at 03:41 PM #
Preved webmastero4ki,
— Ryzcezxq on Thursday, July 17, 2008 at 04:53 PM #
Preved webmastero4ki,
— Jjwcnixs on Thursday, July 17, 2008 at 06:47 PM #
Preved webmastero4ki,
— Hxzhvsmh on Friday, July 18, 2008 at 01:33 AM #
nice site cool dude 10x ) eustacian tube8 =)
— xtube on Sunday, July 20, 2008 at 05:04 PM #
Cool site, bootz porno, 886,
— Jvgygxmx on Sunday, July 20, 2008 at 08:28 PM #
Sorry, australian porno, 8776,
— Gpjinpzg on Sunday, July 20, 2008 at 10:21 PM #
Sorry, winnie the pooh kanga porno, 357884,
— Qydnrpgl on Monday, July 21, 2008 at 12:27 AM #
Visit this link please, threesome porno, =–),
— Rtqifwfa on Monday, July 21, 2008 at 04:30 AM #
Good luck, rss porno, agdes,
— Ctkmhaxl on Monday, July 21, 2008 at 11:12 AM #
Cool site, porno old young, 8]]],
— Nwqynzmt on Monday, July 21, 2008 at 11:14 AM #
Sorry, porno myspace, aok,
— Vdcwkmob on Monday, July 21, 2008 at 12:58 PM #
Visit this link please, mpeg-1 porno downloads, vpdgbh,
— Ryscecjf on Monday, July 21, 2008 at 01:03 PM #
Sorry, sex porno telewizja, bsry,
— Ubdtuoen on Monday, July 21, 2008 at 03:05 PM #
Preved webmastero4ki, spanish porno sites, =–[[,
— Nytlpexb on Monday, July 21, 2008 at 03:07 PM #
Sorry, ocean porno, ypyc,
— Zgrgfptm on Monday, July 21, 2008 at 05:25 PM #
Sorry, video porno de tommy lee, 913,
— Ffhmnoew on Monday, July 21, 2008 at 07:51 PM #
Preved webmastero4ki, latina porno sites, :-O,
— Ghwiyanr on Monday, July 21, 2008 at 08:33 PM #
Good luck, live porno cams, 79606,
— Ctxyxije on Monday, July 21, 2008 at 10:27 PM #
Preved webmastero4ki, asian lesbian porno, 553,
— Efeobjum on Tuesday, July 22, 2008 at 03:40 AM #
Good luck, teenage lesbian porno, ecsfpd,
— Uyzkpaio on Tuesday, July 22, 2008 at 06:42 AM #
This is a best site, porno chileno, filniu,
— Sbbqpddv on Tuesday, July 22, 2008 at 09:38 AM #
Preved webmastero4ki, porno preveiws, ifmmsy,
— Fbgupwyn on Tuesday, July 22, 2008 at 08:18 PM #
Sorry, porno utube, xipk,
— Irwqayli on Wednesday, July 23, 2008 at 01:13 AM #
Good luck, videos porno de adolesentes, gzrx,
— Fspwruyk on Wednesday, July 23, 2008 at 03:20 AM #
Nice stuff, bangladeshi sex porno vieos, >:–),
— Ehkzqiaj on Wednesday, July 23, 2008 at 05:37 AM #
Preved webmastero4ki, cuanto gana una actriz porno, =OOO,
— Gctaccio on Wednesday, July 23, 2008 at 10:24 AM #
Preved webmastero4ki, naked porno, >:-PPP,
— Mqucpmgz on Wednesday, July 23, 2008 at 03:10 PM #
Visit this link please, porno de animales gratis, %-OO,
— Nnpfsuhj on Wednesday, July 23, 2008 at 05:48 PM #
Visit this link please, pam anderson porno, 8PP,
— Cstxzhlz on Wednesday, July 23, 2008 at 11:01 PM #
Cool site, http://sites.google.com/site/sr6a34x0/ extrait porno gratuit, %-PPP, http://sites.google.com/site/lllit2zaa95s/page25 porno old young, 10828, http://sites.google.com/site/ki3rkn71lbdg/page9 vaginal porno, isvaxd,
— Grfulbqy on Wednesday, July 23, 2008 at 11:47 PM #
Preved webmastero4ki, http://sites.google.com/site/sr6a34x0/page8 dirty porno cartoons, xrdwb, http://sites.google.com/site/sr6a34x0/page2 porno zastonj, clwiy, http://sites.google.com/site/lllit2zaa95s/page23 zastojn porno video filmi, %-DD,
— Nffyngko on Thursday, July 24, 2008 at 02:38 AM #
Sorry, exgirlfriend porno pics, 4763,
— Xoawphav on Thursday, July 24, 2008 at 04:05 AM #
Visit this link please, porno tune, 496,
— Gflxljww on Thursday, July 24, 2008 at 06:33 AM #
Good luck, http://sites.google.com/site/ki3rkn71lbdg/page7 porno puke, %–(, http://sites.google.com/site/ki3rkn71lbdg/page10 pornos gratuits, 9502, http://sites.google.com/site/sr6a34x0/page24 extreme german porno girls, 2422,
— Eaosqwpi on Thursday, July 24, 2008 at 11:24 AM #
Good luck, porno espanol, 8-))),
— Bhjehook on Thursday, July 24, 2008 at 11:42 AM #
Visit this link please, chatear porno, 020952,
— Nzsktywo on Thursday, July 24, 2008 at 02:13 PM #
Visit this link please, http://sites.google.com/site/r0868lzeg9g/page27 latina porno sites, 73047, http://sites.google.com/site/lllit2zaa95s/page13 babysitter porno, =PP, http://sites.google.com/site/r0868lzeg9g/page21 heatwave studio pornos, 0166,
— Bobzubip on Thursday, July 24, 2008 at 05:03 PM #
This is a best site, http://sites.google.com/site/r0868lzeg9g/page13 babysitter porno, qse, http://sites.google.com/site/lllit2zaa95s/page29 clasic short porno movies, gyi, http://sites.google.com/site/sr6a34x0/page32 gorditas calientes porno, scyimp,
— Njvnaqll on Thursday, July 24, 2008 at 07:45 PM #
Cool site, http://sites.google.com/site/7c71v00qf7/ mom and son porno, tnh, http://sites.google.com/site/8703kz66l53a4/page25 porno smoking matures gallery, ojlbov, http://sites.google.com/site/5ash6820287s/page22 erotika xxx porno, =-OOO,
— Zlqwoelw on Friday, July 25, 2008 at 12:12 AM #
Cool site, http://sites.google.com/site/r0868lzeg9g/page21 girl on girl free porno, dixzet, http://sites.google.com/site/ki3rkn71lbdg/page27 italiano porno filmati video, 928724, http://sites.google.com/site/lllit2zaa95s/page23 dbz porno, =))),
— Ksjsgwmr on Friday, July 25, 2008 at 01:06 AM #
Nice stuff, http://sites.google.com/site/0fgo26168bo7t/Home latina porno sites, 64368, http://sites.google.com/site/8703kz66l53a4/page19 porno video downloads, >:–]]], http://sites.google.com/site/5ash6820287s/page19 girl on girl free porno, =((,
— Zyolcxig on Friday, July 25, 2008 at 02:47 AM #
Nice stuff, http://sites.google.com/site/0fgo26168bo7t/Home latina porno sites, 64368, http://sites.google.com/site/8703kz66l53a4/page19 porno video downloads, >:–]]], http://sites.google.com/site/5ash6820287s/page19 girl on girl free porno, =((,
— Zyolcxig on Friday, July 25, 2008 at 02:48 AM #
Visit this link please, http://sites.google.com/site/r0868lzeg9g/page14 mom and son porno, 012307, http://sites.google.com/site/lllit2zaa95s/page3 tila porno, =(, http://sites.google.com/site/ki3rkn71lbdg/page27 cuanto gana una actriz porno, >:-OO,
— Ubihjdrb on Friday, July 25, 2008 at 03:53 AM #
Visit this link please, http://sites.google.com/site/7c71v00qf7/page15 tammy sytch porno, tdu, http://sites.google.com/site/hkv73i8/page3 porno casting call, 727, http://sites.google.com/site/hkv73i8/page24 porno photo, 91204,
— Dgzcpllm on Friday, July 25, 2008 at 08:05 AM #
Leave a comment