OSX, Tools

Hiding .DS_Store files on your desktop while still showing hidden files

Like most developers the first thing I do when I get a new mac or do a clean install is run the below terminal command to show all hidden files and folders.

defaults write com.app.Finder AppleShowAllFiles Yes
killall Finder

This is a necessary evil as now I see Dot files on my desktop. For me this is the annoying .DS_Store and .localized files.   The only way I’ve found to not show these on my desktop yet have hidden files enabled is to change their icon to transparent.  This is very much a hack but accomplishes it’s goal in only a few clicks.  Below is a step by step tutorial on how to get your clean desktop back.

Step 1: Getting the transparent image

This first thing you need to do is copy the below transparent image.  I’ve placed border around the image to make it easier to find.

transparent

To copy the image just right click on Safari and select the Copy Image  option as illustrated below.

CopyImage

Step 2: Get Info

The next step is to right mouse click on the .DS_Store file on your desktop and select “Get Info” as shown below.

getInfo

Step 3: Updating the icon

This opens a dialog with all of the information about your .DS_Store file.  You want to click on the document icon at the top left of the dialog and paste the image copied as part of step 1.

info-dialog

You will see the info dialog icon disappear.

step3-a

After closing the info dialog you will also notice that the .DS_Store icon disappears on your desktop.  Now you just need to repeat the process for each Dot file you wish to hide.

step3

Step 4: Hiding the icon text

Now that the icons are hidden, you will simply see the icon text.  I haven’t found a good way to remove the text but this is easy enough to hide.  If you simply drag the icons off screen, for example to the bottom right of your screen as shown below. Their text will be out of view and they will be out of sight out of mind.

dock-icon-hidden

Although this is a major hack, it does provide those of us that like to have a clean desktop some peace.

Results

Below shows the before and after results.

beforeafter

Wallpaper by Justin Maller.