Hide MacOS Desktop icons using CLI

Published in: CLI, MacOS

One of my biggest pet peeves is clutter. I could very well have OCD (though not formally diagnosed). I often find myself spending an insane amount of time organizing things or optimizing thing (ie, page load of this site), which could have very well been spent on things more important, like actually writing articles. Obcourse being clutterless and organized has its benefits, I have less visual noise to get distracted about, and I have found that integrating minimalist in my life has actually improved my concentration and also increased my productivity.

I tend to keep my desktop organized with a folder by projects, for easier access – like a poor man’s mind map. But when I don’t need those folders, they can be very distracting visual noise, it better to hide them.

Thankfully in OSX (my main work computer OS), this can be easily achieved with CLI command, the command itself is not very user-friendly:

To hide Desktop icons:

defaults write com.apple.finder CreateDesktop false; killall Finder

To unhide Desktop icons:

defaults write com.apple.finder CreateDesktop True; killall Finder

But you can make this easier by creating an alias by editing like thisnano ~/.bash_profile and adding you alias:

alias hide="defaults write com.apple.finder CreateDesktop false; killall Finder"
alias unhide="defaults write com.apple.finder CreateDesktop True; killall Finder"

So next time all you have to do it type hide to hide your desktop icons or unhide to unhide show your desktop icons.




about | twitter | facebook | archive | rss