all of my folders appeared on my desktop; how do I remove them

I had nothing on my desktop except my dash, which is hidden, and docky; suddenly all of my folders are there and I have no idea why; can anyone tell me how to remove them?


Solution 1:

Check the contents of your hidden configuration file ~/.config/user-dirs.dirs. (In your file manager, turn "Show Hidden Files" on. You now will see a folder .config in your home folder that contains the file user-dirs.dirs. Open it with a text editor.) There should be an entry for your desktop, which by default on Ubuntu read as:

XDG_DESKTOP_DIR="$HOME/Desktop"

In your case, the entry probably simply points to $HOME, causing your entire home folder to display on the desktop. Just change the entry back as shown using a text editor.

You might have inadvertently changed the entry by deleting the Desktop folder at some point. Behind the screens, such actions update the .config/user-dirs.dirs file.