abm (14) amp (18) ascape (6) biomed (6) business (22) butterflyzer (9) dharma (12) eclipse (62) emf (7) graphics (10) ip (8) java (35) life (5) osx (13) science (13) web (6) xpand (5)

Wednesday, August 11, 2010

De-obfustacting Eclipse dock icons in OS X

OK, I am long over-due for an update to the blog, and I have lots to report on, but I've been deep in build hell for the last week, (and the week before I left for retreat, and a week before that...) so no time to spend on the fun stuff. Still, I had to find something silly (and hopefully a bit useful) to do for a half a half an hour or so. I don't know if this is a familiar scenario for other Eclipse users, but I seem to spend a lot of time with multiple Eclipse instances open, and I end up no being able to keep one instance straight from another.

So, to identify what version I want to pop over to in the app switcher or the dock I needed some way to change the icon in both places. Turns out that this is one of those annoyances that is super easy to fix, and once you do you wonder why you put up with it for so long. The first thing I thought of was to change the eclipse.ini file, but it turns out that like a lot of things having to do with Eclipse configuration, the -Xdock:icon property in this context is totally vestigial -- or at least it doesn't actually seem to do anything. But the answer is even simpler than that. Here's what to do, and again, it ain't rocket science:


  1. Right-click on your Eclipse Application

  2. Select "Show Package Contents"

  3. Open Contents:Resources

  4. Replace the Eclipse.icns image with a different one

  5. Enjoy some new found clarity.



As a bonus (today only!!) I've even included some icons for you to use:

Blue Eclipse Icon
Green Eclipse Icon
Gray Eclipse Icon
Teal Eclipse Icon

Snazzy, huh? Now instead of this:



You get this:



[By the way, why does it take blogger.com five lines of html to insert one image? And why isn't their editor smart enough to not not create extra BRs between li tags? And why can't they make an editor that displays more than twenty lines of text at a time. Basically, with everyone crowing about how everything is going to web applications, why can't anyone seem to create one with a larger text window than the VT102 I used in high school? I mean, doesn't Google have like billions of dollars in spare cash to hire a few decent web programmers for blogger?]

To use a different icon for hosted Eclipse Application Runtimes, go to the Arguments tab of your Run Configuration for your app and add the following line to your VM Arguments:

-Xdock:icon=/Path/where/you/put/the/damn/thing/EclipseGray.icns


If you haven't done it before, it's really easy to make your own .icns file. Just:


  1. Install XCode Developer tools if you don't have them.

  2. Open Icon Composer in Developer:Applications:Utilities.

  3. Open up an icns file you already have, like the Eclipse.icns. Or just create one form scratch. (I really don't need to spell this out I guess..

  4. Copy the images you've edited into the cells.



You can just drag and drop from your image editing program into the boxes, assuming that they are compatible. I just use Preview for my editing, and for the icns above I just used the nifty Adjust Color tool. These aren't the most attractive icons in the world, but they'll do. It's amazing what you can do with the built in Preview tool plus a little creative cutting and pasting. I thought about creating some icons for say "Runtime", "Modeling", etc.. but I've already spent enough time on this. Back to hell for me.

4 comments:

  1. Miles,
    thanks for sharing this
    ekke

    ReplyDelete
  2. Hi Miles,

    nice rant about blogger.com. Try Google's Chrome browser - it allows to resize text areas on the client side. I guess it works for the blogger-widgets as well.

    Cheers,
    Sebastian

    ReplyDelete
  3. Nice to know how to change those icons. I really would prefer a textual overlay with 3.6M6 3.7 etc. instead of adjusting the color. What tool would be easiest to use for adding small texts on top of the existing icon images?

    ReplyDelete
  4. Hi Hallvard,

    See my next post for more creative ways to waste time.. :)

    http://milesparker.blogspot.com/2010/08/eclipse-dock-icons-part-deux.html

    cheers,

    Miles

    ReplyDelete

Popular Posts

Recent Tweets

    follow me on Twitter