If you use the iStat Pro dashboard widget you may have noticed the following issues after you updated to new version of OS X such as Mountain Lion.

  • Processes stopped listing correctly after you installed Mountain Lion.
  • It also no long displays your external IP address.
  • There is also a cosmetic issue with the way hard drive usage is displayed when the widget is in Tall mode.

The developer has, apparently, announced they will not update it for full Mountain Lion (10.8.x) compatibility. There is, however, a very easy DIY fix. Here’s how.

Credit for these fixes goes to the many folk in the Macrumors forum who collectively provided a way to fix iStat Pro.
You can find that discussion here: http://forums.macrumors.com/showthread.php?t=1407448

If you don’t wish to apply all these fixes yourself, jump to the bottom of the article. You can then download the modified widget and install it.

Fixing the Processes display

First let’s get the Processes displaying

  1. Find the widget file. It will be in ~/Library/Widgets or /Library/Widgets
    In Finder use the Go menu, and select Go To Folder. Copy and paste in the above file location.
    The file you are looking for is called iStat Pro.wdgt
  2. If you can’t find your ~/Library/     (which is the   /username/Library/) folder, plug this command into Terminal to permanently unhide it:    chflags nohidden ~/Library/
  3. Control-Click (or double click / two-finger click) on the file. Select Show Package Contents.
  4. Depending on the view mode you use in iStat Pro, you need to edit one or both of these files: wide.js and/or tall.js – I recommend editing both. Use any text editor.
  5. Search for this bit of code:     PID|$1
  6. Change it to:  PID| $1       You are simply adding one space in front of the $ sign.

You should end up with this code segment looking like this (changed code in bold):

WideSkinController.prototype.updateProcesses = function(){
var _self = this;
var exclude = "";
if(p.v("processes_excludewidgets") == 'on')
exclude = " grep -v DashboardClient | ";
if(p.v("processes_sort_mode") == 'cpu')
widget.system('ps -arcwwwxo "pid %cpu command" | egrep "PID|$1" | grep -v grep | ' + exclude + ' head -7 | tail -6 | awk \'{print "<pid>"$1"</pid><cpu>"$2"</cpu><name>"$3,$4,$5"</name></item>"}\'', function(data){ _self.updateProcessesOut(data);});
widget.system('ps -amcwwwxo "pid rss command" | egrep "PID|$1" | grep -v grep | ' + exclude + ' head -7 | tail -6 | awk \'{print "<pid>"$1"</pid><cpu>"$2"</cpu><name>"$3,$4,$5"</name></item>"}\'', function(data){ _self.updateProcessesOut(data);});

Fixing the external IP address issue

Next let’s get the external IP address displaying. You will notice it says Ext: Unknown.

  1. The file you need to edit this time (using the above instructions on how to find the widget) is ../scripts/core.js
  2. Find and replace the code in bold:
function getExtIP(){ ipURL = 'http://whatsmyip.islayer.com/?random='+new Date().getTime(); ipConnection = new XMLHttpRequest(); ipConnection.open("GET",ipURL,true); ipConnection.onreadystatechange = function() {

Replace it with the code in bold below:
function getExtIP(){
        ipURL = 'http://ip.bjango.com';
        ipConnection = new XMLHttpRequest();
        ipConnection.onreadystatechange = function() {

If you have your own web server or shared hosting account, an alternative option is to place a small php file on the server. Create a file with the name ip.php (or something along those lines). Put the following code into it:

/* $Id: ip.php,v 1.3 2008/09/24 13:58:49 pblankenbaker Exp $
* Small PHP script to "echo" back the IP address of the remote
* system as it appears to the server.
* Example client side usage:
* wget http://www.networksecuritytoolkit.org/nst/tools/ip.php -O -

// Echo back IP address as a "plain text" document

header('Content-type: text/plain');

// Check to see if server has been forwarded the request
if (isset($_SERVER['HTTP_X_REMOTE_ADDR'])) {
printf("%s\n", $_SERVER['HTTP_X_REMOTE_ADDR']);
} else {
printf("%s\n", $_SERVER['REMOTE_ADDR']);

Save this file to a publicly accessible folder on your web server. In the www root will do the trick. If you are going to use this method, then the correct final code change for the above mentioned ../scripts/core.js file is this:

function getExtIP(){
        ipURL = 'http://YOURDOMAIN.COM/ip.php';
        ipConnection = new XMLHttpRequest();
        ipConnection.onreadystatechange = function() {

You need to replace YOURDOMAIN.COM with the domain of your web site.

Fixing hard drive indicators in wide mode

Istat drive fix

If you use iStat Pro in wide mode you will notice the usage indicators for the hard drives have two bars instead of just one. The image to the right shows an example of what I mean.

Here is how to fix that.

Using the same instructions above to locate and open the widget file, do the following.

  1. Open core.css in a text editor.
  2. Find the following line of code:  .barbg { 
  3. Edit the file so that it looks like this:
.barbg {

.verticalbarbg { background-image:url(./images/common/bar_vertical_bg.png); width:8px; overflow:hidden; background-position: -4px 0; }

.verticalbar { background-position: -4px 0; }

canvas { background-image:url(./images/common/graph_bg.png); }

You need to add in the blue lines of code shown above. Save the file.

Restart the Dashboard

After you have applied all the changes, save your modified files, and restart the dashboard with the following command in Terminal

killall Dock

Download the fixed iStat Pro files

iStat Pro is no longer available for download on the Apple Widgets site. If you need it below is a link to the full and nano version. Or perhaps you don’t feel like getting your hands dirty with code, and want the finished update.

Download from here