Porting Color Themes to Xcode 4
If you’re like most developers you’re probably pretty picky about how code looks on the screen; you’ve probably customized the look and feel of Xcode so those long hours planted in front of the screen are (hopefully) less taxing on your eyes.
If you’re also playing with a certain developer preview release of a certain Apple development environment, you’re probably missing your beloved theme because the theme files don’t work from Xcode 3 to Xcode 4…
Thanks to an anonymous hacker who goes by the moniker of “MrEvilMe” you can port your favorite Xcode 3 theme to the new hotness in a jiffy, Here’s how:
- Download the contents of this gist from GitHub; according to the internal command-like help the file name is “xcode3_theme_to_xcode4.py” but you can really name it anything. I called my copy xc4converter.py
- Put the script in an easy to remember place (I have a “~/bin” directory for these kinds scripts)
- Change the file’s mode to 755 (e.g., chmod 755 filename) to make the file executable
- Open a terminal window and cd to ~/Library/Application Support/Xcode/Color Themes – this is where the Xcode 3 .x themes live. [Update: if you have never customized any Xcode themes, this directory will not exist -- and IIRC, all the "default" Xcode 3 theme are present in the Developer Preview, so really this process is only useful to you if you've made at least 1 custom theme...]
- Invoke your copy of the converter script on the theme you want to transfer, e.g., ~/bin/xc4converter.py dusk.xcolortheme
- The result will be a new copy of the file with the extension “.dvtcolortheme” This is the Xcode4 compatible file
- Move this file to ~/Library/Developer/Xcode/UserData/FontAndColorThemes and restart Xcode and you should be good to go.