We sometimes take screenshots or videos of Desktop and at that time the Desktop is cluttered with Applications icons, files and folders and other things. Which does not look good on video or screenshot or some even need to hide those for Presentations using a projector, but like windows there is no option of hiding Desktop icons in Mac.
But you can hide all your desktop icons in mac using the following command in your Terminal Application :
defaults write com.apple.finder CreateDesktop false; killall Finder
and can make the icons visible again by changing 'false' to 'true' in the above command and command will become like this :
defaults write com.apple.finder CreateDesktop true; killall Finder
Now that is easy, but who can remember the code always and use it ?, So the solution to it is using a AppleScript with Automator application in mac which I found on LifeHacker. they have mentioned How to use it with Automator application.
Using Alfred Workflow
But quite frankly I don't like or was unable to understand how to hide desktop icons using Automator, the AppleScript is working quite fine when running it.
Hide desktop icons using Terminal Aliases
If you don't like Automator or Don't have Alfred than don't worry, we still have an alternative that is using
Aliases in Terminal App for that just follow the below steps:
- Open your Terminal Application
.bash_profilefile in a text editor of your choice I will use vim by using follow command:
- Then paste the below code (if you are using vim then press i to insert the text) :
#Aliases # Hide Desktop Icons alias hideicons="defaults write com.apple.finder CreateDesktop false; killall Finder" # Show Desktop Icons alias showicons="defaults write com.apple.finder CreateDesktop true; killall Finder"
- Save the file. (for vim press esc and then press :and type
wqthat will save the file)
- now quit and restart Terminal or reload
.bash_profileby using following command :
Now you can Hide Desktop icons whenever you want by typing "hideicons" in terminal, and to show desktop icons again type "showicons".