Mar 03, '06 06:45:00AM • Contributed by: Anonymous
There are a lot of widgets on my Dashboard that display some information that I'm interested in (such as weather, RSS feeds, application updates, daily comic etc.), but that aren't so important that I'm actually going to activate the Dashboard to see them. These are kinds of things I just want to stumble across from time to time. So I thought it would be convenient if the Dashboard could show up by itself in the way a screensaver would.
Starting with this hint and this discussion, I found out how to get the system idle time. I used this info to write a script that runs in background and takes two arguements. The first one gives the system idle time in seconds after which the Dashboard should show up, and the second one determines what time in seconds the script should sleep between execution.
Copy and paste the script into your favorite editor, save it somewhere, and remember to make it executable (chmod a+x script_name). You can then execute it, remembering to specify the two time arguments. For example:
dashsaver 300 60
would activate Dashboard after three minutes of inactivity, and then the script would sleep for a minute before checking again. (Use an ampersand at the end, i.e. dashsaver 300 60 &) to run the program in the background.) After executing this script, the Dashboard behaves like a screensaver and activates itself after a given time -- even though you have to push F12 or click the mouse to deactivate it again, not just move the mouse.To make the script a startup item, one could use launchd with the following as .plist file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.xxxxxx.DashSaver</string>
<key>OnDemand</key>
<false/>
<key>ProgramArguments</key>
<array>
<string>bash</string>
<string>/path/to/script/DashSaver.sh</string>
<string>600</string>
<string>60</string>
</array>
</dict>
</plist>
Just save this as com.xxxxxx.DashSaver.plist (replace the x's with whatever you like, and replace 600 (delay until activation) and 60 with your preferred times) under ~/Library/LaunchAgents, and the script will be executed at login.
