There are a number of reasons why Mac OS X’s Spaces feature hasn’t taken the Mac-using world by storm. But one of the most frequent criticisms I hear is a simple one: You can’t assign a different Desktop background to each Spaces workspace. It’s an obviously useful feature—the more visually distinct each workspace is, the more mentally distinct your workspaces become, making Spaces easier to integrate into your workflow.
Back in 2008, I covered a then-promising utility, Hyperspaces, that includes just such a tweak to Spaces (along with many other features); since then, Hyperspaces has improved significantly, and is worth a look if you use Spaces. I’ve also come across, but not tested, SpaceSuit. But today’s Hint describes a way to get a different-desktop feature in a way that’s both frugal with system resources and free.
This system tweak, SpaceStation, is a clever combination of an OS X launch agent and a background process that updates your Desktop image whenever you switch spaces. It was created by Ars Technica forum guru serversurfer; you can download the 29k .zip archive here.
After you unzip the SpaceStation folder, double-click SpaceStation Installer.app, a handy AppleScript installer that does most of the dirty work for you, and click Install. The installer places the background process in /Library/Application Support/SpaceStation, the launch-agent .plist file in ~/Library/LaunchAgents, and a preferences file—which I’ll get to in a moment—in ~/Library/Preferences. Then log out and back in to ensure the launch agent is running. (If you want to use SpaceStation in multiple accounts on your Mac, you’ll want to run the installer from within each account.)
Next you need to configure SpaceStation. Open your Preferences folder (~/Library/Preferences) and double-click the preferences file named com.beardedllama.SpaceStation.plist. If you don’t have Apple’s Developer Tools installed, the file will open in your default text editor; if you have the Developer Tools installed, the file will open in Property List Editor. (You could also use a third-party utility such as PlistEdit Pro.)
In either case, you’ll see a list of 16 numerical keys—preference values—along with a Default key. Each of these settings corresponds to a workspace. More specifically, each numbered setting hosts the path to the Desktop image for that workspace: key 1 determines the image for workspace 1, key 2 for workspace 2, and so on. (The Default key determines the image used for any workspace to which you haven’t assigned a specific Desktop image.)
In other words, instead of a nice graphical-interface method for assigning a different image to each workspace, you must manually change the setting in this preferences file. If you're using a text editor, type or paste, in between
</string> on the line just below
<key>1</key>, the path to the image you want to use as the Desktop background for workspace #1 (for example,
/Library/Desktop Pictures/Nature/Clown Fish.jpg). Here's what the two lines representing workspace #1 might look like:
<key>1</key> <string>/Library/Desktop Pictures/Aqua Blue.jpg</string>
If you’re using Property List Editor, instead double-click the Value field to the right of String for Picture 1, and then type or paste the path to the desired background image for workspace #1. (You can drag an image file into the Value field to have the image's path entered automatically.)
Whichever method you use, repeat the procedure for each workspace you use regularly; I use only four workspaces, so I needed to assign an image to only keys 1 through 4. (Note that the lines are sorted alphabetically, rather than numerically, so 2 comes after 16.) Then save your changes.
To force SpaceStation to use your new settings, you can either log out and then back in, or you can launch Terminal (in /Applications/Utilities), type
killall -2 spacestationd and then press Return. The latter approach immediately quits the SpaceStation process, which is then automatically relaunched using your new settings.
From this point on, whenever you switch to a different workspace, the SpaceStation background process notices the switch, checks to see which workspace is active, and then sets the Desktop image accordingly. By default, SpaceStation checks for workspace switches every 0.1 seconds, but you can modify that interval by changing the value for ScanInterval in the same .plist file you previously edited.
With the default interval, I found the SpaceStation background process used only 0.2 percent of CPU overhead and approximately 5MB of RAM under Snow Leopard. If you ever want to remove SpaceStation, just launch SpaceStation Installer.app again, but this time click the Uninstall button.
The biggest limitation of SpaceStation, as opposed to a product such as HyperSpaces, is that if your Mac has multiple displays, SpaceStation works only with the primary screen (the one with the menu bar); other displays keep the same Desktop background you manually assign them in System Preferences, regardless of which workspace is active.