Wednesday, July 18, 2007

.jar theming

Normally, I try to stay as far away from java applications as I possibly can. They're slow, bulky, fussy, memory hogs, and normally a pain in my ass. (N.B.: For everyone that just sent me comments and/or emails about their favorite java application being fast, efficient, etc. - don't bother. I'm sure that you have some slick application that highlights all the great things about java. That's great. That doesn't change my user experience dealing with java applications, however. If I haven't run across your favorite application and experienced the wonders of that particular java application, chances are, I don't want or need that particular application.)

This being said, I have some java applications that I rely on for work or for working, in general. Things like netbeans / eclipse are simply irreplaceable to me. I'm a ruby developer and I use linux - so unless I'm willing to develop severe cases of OCD/ADD while attempting to control my huge/enormous/OMFG-sized applications/projects with a simple text-editor & file-manager... I need an IDE for my ruby / rails work. Netbeans / Eclipse are the two platforms that I use (my future review of the netbeans ruby ide coming soon!) to control my unwieldy .rb subjects.

Another of these I-have-to-use-this-or-else java applications is Freemind. There simply isn't a better mind-mapping tool available for linux. It has just an unreal amount of features.

Many of my applications aren't java-per-se, but rely upon java / java APIs... like Open Office, Firefox, Thunderbird, etc.

Now, one of the niftiest things about Firefox and Thunderbird is that while they don't use your system themes (gtk / qt, etc.) - they do allow you to install theme packages - which are simple jar files. It's not too hard to create a theme file for firefox / thunderbird, either (it does require ample amounts of repetition and the willingness to create odd toolbar multi-icon images though... reminds me of the xmms / winamp skinning days!)

So, I use firefox and thunderbird now (evolution just will not work for the volume/type of email I get anymore, oddly enough - I recently switched to thunderbird.) I've installed some custom themes for both firefox and thunderbird, based upon the theme I use for my system. Everything looks integrated (thanks Tango team!)

But what about applications like Freemind and Azureus? These applications are a single jar file without theming capabilities. Am I stuck with their *HORRENDOUS* toolbars & icons?!

Well....

The simple answer is "not really." The more complex answer is - if you're using gnome and have file-roller installed, you're not stuck with their themes.

The easiest way to make new themes for Freemind (or Azureus) is to take a copy of the freemind.jar file (from the working directory - mine is /usr/share/freemind), make a new directory in your home folder and extract the contents of the jar file into the new directory. (Make sure you put the copy of freemind.jar into this new directory as well!) Then, simply over-write all of the icons you don't want with icons you do want in your new directory.

Now, the magic involved in turning your custom icons into a working Freemind application uses File-Roller.

Simply click on the copied freemind.jar file in your directory and file-roller will open the contents as if it were any other packaged file. All you have to do is navigate around the contents inside of file-roller, find the directory that contain an icon you want replaced and simply drag your custom icon from your working directory into the matching directory inside file-roller and drop the file. File-Roller will swap the old icon for your new icon image in the jar file.

When you're done swapping icons, simply close file-roller - your updates have already been made. To be safe, move your original freemind.jar file to freemind.jar.bak (in the original directory - mine is /usr/share/freemind) and then copy your new freemind.jar into the original directory (mine is /usr/share/freemind.) When you start Freemind now, you will have custom icons! :)

Using the file-roller drag & drop approach allows for making new firefox themes a snap too - just start with a theme you already like, and do the same thing as with the freemind.jar file. :)

*You probably have to be somewhat anal-retentive to want to change the icons inside of freemind or azureus to begin with... argh.

0 comments: