Here’s a fun trick for a post-long-weekend “virtual Monday.” Today’s tip may not be all that useful, but it’s certainly impressive, and a great demonstration of some of the graphical capabilities of OS X. You’re probably well aware of OS X’s collection of screen savers—available in the Desktop & Screen Saver System Preferences panel.
What you might not know, however, is that you can run these screen savers in real time, right on your desktop. That’s right, you can have a screen saver running as your desktop, even while you’re working on other stuff. Now, obviously, depending on the speed of your machine and which screen saver you’ve chosen, this might bring your Mac’s CPU to its knees, so this isn’t necessarily something you’ll want to leave running all the time.
Once enabled, the effect can be quite interesting, as you can see in this brief movie—note that you’ll need QuickTime7 to see the clip, as it’s encoded with the H.264 codec. That’s a bit of the Beaches screen saver doing its best “Ken Burns effect” zoom while I work in a Finder window in the foreground. To get this own effect on your machine requires that you (a) have a screen saver selected in the Desktop & Screen Saver preferences panel, and (b) that you type one somewhat-lengthy command in the Terminal.
As an alternative, there are a large number of freeware and shareware applications out there that will let you enable this feature without any of the following knowledge. Note that not everything in that listing does exactly this, but a good many of them do. Also, I haven’t tested any of those programs, so I can’t comment on which one(s) may be the best option for you to consider. If you’d like to learn the secret behind these programs, keep reading…
First, make sure you’ve got an active screen saver by opening System Preferences, clicking on the Desktop &; Screen Saver panel, clicking on the Screen Saver tab, and then choosing any screen saver. This trick works with any screen saver—those provided by Apple, third-party savers, and even the iPhoto screen savers. Once you have a screen saver selected, close System Preferences and switch to the Terminal (in /Applications: Utilities).
In the Terminal, type this command:
You can copy and paste the text, or type it out yourself if you’d like to give your fingers a workout. When you hit Return, your chosen screen saver will launch in the background, and you can then go right back to whatever else you were doing. When you tire of the effect, switch back to Terminal and hit Control-C to end the process.
A good thing to do once you have the screen saver active is to see how much of your CPU is being used for this bit of magic. Launch Activity Monitor (in /Applications: Utilities), and click on the %CPU column heading (to sort by CPU usage), and make sure you see a downward-pointing triangle, which may require a second click (this sorts the results from most to least CPU usage). Look for an entry for ScreenSaverEngine, and click once to make it more visible, as seen here:
As you watch, the CPU usage for the screen saver will jump around a bit, but you’ll get a good feel, in general, for how much of your CPU it’s using. If the screen saver is using a high percentage of your CPU, you may notice effects such as audio skipping, slow typing, and sluggish application switching. If that’s the case, your machine probably isn’t fast enough to run the screen saver while also being used in its normal fashion.
Note: The following section is completely optional, and just makes it easier to use this trick in the future. Feel free to skip it if you don’t mind typing (or copying and pasting) whenever you want to demonstrate the screen saver on the desktop.
OK, so you’re still reading. Here’s how to make this trick much easier to use in the future. First, hit Control-C in the Terminal if you’ve still got the screen saver running on the desktop. Next, we’re going to use the Terminal to check for the existence of a couple files in your user’s home directory. Type the following two commands, pressing Return after each:
$ cd ~$ ls -al .bash_profile; ls -la .profile
If the output contains either .bash_profile or .profile, then you’ll have to amend the following instructions to edit the appropriate file, instead of creating it from scratch. Of course, if you have such a file, you’re probably comfortable with editing it already, since it doesn’t exist by default. If the output of the command is nothing other than the return of the command prompt, then you can use the following instructions as written.
This file (under either name) is run every time you open a new Terminal window, and it can contain a variety of commands and settings. One of the things you can do with it is to create an alias, which is how we’re going to use it. This isn’t an alias like a Finder alias. Instead, a Unix alias is really a way of creating a new command for your own use. So launch TextEdit (or use the Terminal if you’re comfortable editing with pico or vi, etc.), and make sure the new blank document that appears is in plain text mode (Format -> Make Plain Text). Paste in the following command:
alias ssbg='/System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine -background'
It’s very important to note that the above should be one long line, with no added spaces at all, other than before -background. The first bit, the ssbg part, is the name of the command we’re creating. Feel free to change that to whatever you like, but keep it short (since you’ll have to type it in), and don’t put any spaces in the name.
Once you have the line entered, select File: Save. For the save location, pick your user’s home directory—that’s the one that holds the Documents, Pictures, and other user-level folders. For the file’s name, enter .bash_profile. At the bottom of the Save dialog, you must uncheck the ‘If no extension is provided, use “.txt”’ option, too—otherwise, your saved file will not work. Press Save when you’re ready, and then open a new Terminal window. Type alias and hit Return, and you should see your new command. From now on, to run the screen saver on the desktop, you just need to type ssbg (or whatever name you used for the command).