How to Unhide Desktop Icons on macOS

One day I realized all of the desktop icons on my 2019 MacBook Pro were missing, but still visible in Finder. I thought maybe it was a bug in Big Sur 11.4 but I eventually found the solution.

There is a command to hide the icons on the desktop:

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

I don’t remember running it, but by setting CreateDesktop to TRUE and restarting Finder, all my icons showed back up!

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

To make this easier in the future, I added a function to my shell:

# Pass TRUE or FALSE - toggles desktop icons on and off.
function toggle_desktop_icons()
{
if [ -z "$1" ]
then
echo "You must pass 'TRUE' or 'FALSE' to this function!"
echo "Try 'toggle_desktop_icons true' or 'toggle_desktop_icons false'"
echo ""
echo "Aborting!"
return 0
fi
 
defaults write com.apple.finder CreateDesktop $1; killall Finder
}

References

Andrew Mason's profile image

Hey, I'm Andrew 👋

I'm a senior product engineer at Podia, co-host of Remote Ruby and Ruby for All, and co-editor of Ruby Radar. You can explore my writing, learn more about me, or subscribe to my RSS feed.

Page Info

Published:
05 June 2021
Updated:
08 February 2022
Reading Time:
1 min read

Tags