Weather Widget

Scottfab

Helpless Mac Newbie
macosxhints has a hint on how to make the weather widget always update. but when I tried to save it, it said its read only, and I dont know how to make it not read only. I couldnt do it through 'get info'

here's the hint:

Normally, Tiger's weather widget only updates when the widget screen is active. This is a rather poor implementation that causes a bit of frustration for people who casually just peek at the weather, but appears to have been intentional.

A minor modification to the widget's underlying Javascript (commenting out four lines of code) will enable the widget to update when the widget display is not active (e.g. in the background). Control-click on the Weather widget in /Library/Widgets and choose Show Package Contents. In the new window that opens, open Weather.js in your favorite text editor. There are two areas to change: the onshow and onhide functions. To find this area, search for function onshow (); the two functions are right next to each other.

In the onshow function, comment out these two lines, as shown:
//if (timer != null)
// clearInterval(timer);
Just below that, in the onhide function, comment out these two lines, again as shown:
//clearInterval(timer);
//timer = null;
Save the file, quit the editor, open the widget and hit Command-R, and you should have a constantly-updated widget.

[robg adds: I edited this hint relatively extensively (it originally was a diff of the before and after), so any mistakes are mine. That said, I used these instructions to do the edits, so I'm pretty sure they're right. You'll need to have root abilities to edit this file -- so if you're working in the Finder, you'll need to use Get Info to change its permissions first, and remember to change them back when you're done. In the Terminal, just use sudo to edit with root capabilities.Remember to make a backup before you edit, though in this case, the changes are easy enough to undo...]
 

Damrod

Registered
1. Save the file as a copy on your desktop.
2. Search the Widget, and control click -> "Show Package contents".
3. Drag the File from your desktop to the place the original file is located
4. The Finder will tell you that you lack the necessary rights to do so. You'll see an OK-button and an authenticate(sp?) button. Click the latter one
5. Confirm the appearing replace dialogue, and enter your password.
6. You should be set :)
 

Captain Code

Moderator
Staff member
Mod
Keep in mind this will increase the CPU useage of the Weather widget since it's always running instead of sleeping.
 
Top