4 Awesome Terminal Tricks to Tweak Your Desktop
Posted 01/04/2011 at 11:07am
| by J.R. Bookwalter, Cory Bohon, Scott Rose, Ray Aguilera, Adam Berenstain and Paul Curthoys
Terminal’s Unix-style command-line interface may be serious business, but that doesn’t mean you can’t use it for a little monkey business, too. These Terminal tricks show you some interesting tweaks you probably haven’t imagined before, and to save you the pain of meticulously typing in all these commands, you can copy/paste them.
1. Make Your Screensaver the Desktop Background

You know that screensaver, right? Now it’s your wallpaper! Whoa. Trippy.
If you have a nice-looking screensaver like us, you want to see it all the time. Type the command below in Terminal, and your current screensaver will appear as your Desktop’s background image. Then, as with all commands on this page and the next, hit Return.
/System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine -background &
Simple? Check. Fun? Totally. But if you get motion sickness, simply close the Terminal window to return your Desktop to normal.
2. Re-Index Spotlight

If Spotlight’s acting funky, re-indexing will get it up on the right side of the bed.
Spotlight search results not appearing as they should? Force Spotlight to re-index itself with the following two commands:
sudo mdutil -E /
sudo mdutil -i on /
You’ll be prompted for your administrator password. Then, after a few minutes’ delay, Spotlight will begin re-indexing your Mac.
3. Put Spacers in your Dock to Organize Apps

Here’s Cory’s impressively crowded Dock before he added spacers...

...and afterward, those lovely little gaps create logical groupings of kinds of apps.
The Dock is a great place for your most-used applications, but it can get a little crowded. With a Terminal command, you can add spacers to your Dock to organize things a little better. Open Terminal (Applications > Utilities), then type the following command:
defaults write com.apple.dock persistent-apps -array-add '{"tile-type"="spacer-tile";}'
Type the command once for each space you’d like to add, then type the following to restart the Dock:
killall Dock
In the new Dock, you’ll see the spacers to the right of your applications. Drag spacers around to create “sections” of applications in your Dock. To remove a spacer, simply drag it off the Dock.
4. Create a Recent Items Stack in the Dock

Stacks let you quickly access data from your Dock, but Apple doesn’t let you add a stack containing your most recently accessed files or apps unless you use the following Terminal command:
defaults write com.apple.dock persistent-others -array-add '{ "tile-data" = { "list-type" = 1; }; "tile-type" = "recents-tile"; }'
Then restart the Dock:
killall Dock
When the Dock reappears, you’ll find a stack of recent items beside the Trash. To change which items appear in the stack, right-click it to choose Recent Applications, Recent Documents, Recent Servers, Favorite Volumes, or Favorite Items.
Update: We have had some reports of a few users' Docks disappearing and not returning after running the Recent Stacks command in an earlier version of this article. (We had it formatted incorrectly earlier, but it's been fixed.) If this happened to you, the easiest fix is to delete the com.apple.dock.plist and com.apple.dock.db files in ~/Library/Preferences. When you do this and restart, your Dock should return in pristine condition. Remember, this is only for users whose Docks failed to open after restarting their Mac.
