6

I tried to make a shortcut (like Windows) to the downloads folder on my desktop, and later realized it caused the actual downloads folder to move, causing issues. In trying to fix them, I ended up with my home folder "home/cchilder/..." on my desktop. When I open Desktop, I see the stuff my desktop actually had before the issue. Of course I don't want to delete my entire computer, so I can't drag and remove all of this and do a simple restore.

When I delete something in home (~) or on the desktop, the operations mirror each other, and deleting a file from the shell deletes it from the desktop too.

I want to know

  1. How could this possibly happen, and why?

  2. How to restore only the real desktop contents (Desktop folder) and untie the desktop I see from the home folder

Thank you

enter image description here

cchilders@cody_pc:~/Desktop$ ls -sFl
total 100
 4 -rwxr-xr-x 1 cchilders cchilders  271 Jul 18 00:32 atom.desktop*
 8 -rw-rw-r-- 1 cchilders cchilders 4552 Aug 29 01:25 Attributes.docx
 4 drwxrwxr-x 2 cchilders cchilders 4096 Sep 17 01:04 books/
 4 -rw-rw-r-- 1 cchilders cchilders  222 Apr 11 21:05 cook rice 4-11-15~
 4 -rw-rw-r-- 1 cchilders cchilders  195 Aug 28 01:37 DEMO~
 4 -rw-rw-r-- 1 cchilders cchilders  201 Aug 28 04:11 demos~
 4 drwxrwxr-x 4 cchilders cchilders 4096 Jun  4 18:56 django texts/
 4 drwx------ 3 cchilders cchilders 4096 Sep 17 14:13 Downloads/
 4 -rwxr-xr-x 1 cchilders cchilders  791 Apr  4 12:52 gedit.desktop*
 4 -rw-rw-r-- 1 cchilders cchilders 1668 Apr 15 20:00 git-workflow-readme.md
 4 -rw-rw-r-- 1 cchilders cchilders 1662 Apr 15 19:51 git-workflow-readme.md~
 8 -rwxr-xr-x 1 cchilders cchilders 4484 Apr 26 10:46 gnome-terminal.desktop*
12 -rwxr-xr-x 1 cchilders cchilders 8469 Mar 29 01:08 google-chrome.desktop*
 4 drwxrwxr-x 2 cchilders cchilders 4096 Jun 16 18:01 hcc/
 4 drwxrwxr-x 3 cchilders cchilders 4096 Apr 12 18:33 Lynda/
 4 -rwxr-xr-x 1 cchilders cchilders  712 Mar 29 20:21 nautilus.desktop*
 4 drwxrwxr-x 2 cchilders cchilders 4096 Jul 27 20:18 pics backup/
 8 -rw-rw-r-- 1 cchilders cchilders 4223 Jun 28 19:03 quiz
 8 -rw-rw-r-- 1 cchilders cchilders 4223 Jun 28 16:51 quiz~
6
  • Let's see what it is happened. Open a terminal write cd ; cd Desktop, and after ls -sFl. Please post that output, the line about the download directory.
    – Hastur
    Sep 18, 2015 at 20:40
  • The output of ls -ld ~/Desktop please. Sep 21, 2015 at 13:16
  • cchilders@cody_pc:~$ ls -ld ~/Desktop
    – codyc4321
    Sep 22, 2015 at 16:11
  • drwxr-xr-x 8 cchilders cchilders 4096 Sep 9 18:12 /home/cchilders/Desktop
    – codyc4321
    Sep 22, 2015 at 16:12
  • What's the output of cat /home/cchilders/.config/user-dirs.dirs | grep DESKTOP?
    – miyalys
    Sep 23, 2015 at 1:17

3 Answers 3

11

It seems somehow the XDG_DESKTOP_DIR is pointing to your $HOME directory. If that is the case then it should be pointing to $HOME/Desktop

To change this navigate to the .config directory. Ctrl+h shows hidden files/directories in the file manager.

Look for a file called user-dirs.dirs, this is the file you will be editing.

From this file you can set the default directories for various things like Downloads, Documents, Video, etc.

look for the line XDG_DESKTOP_DIR and set it to:

XDG_DESKTOP_DIR="$HOME/Desktop"

Save, exit and restart the file manager and possibly your machine.

1
  • 1
    In UBUNTU i removed ~/Desktop folder, after that all folder and files inside home show in Desktop after startup. this method works for me to solve it. After that a new folder with name Desktop appear in ~ home directory.
    – user968333
    Dec 17, 2018 at 20:36
0

I did exactly same and saved. When i restart the machine everything is the same as before and nothing changed in the user-dirs.dirs. When i hit ctrl+h every hidden file shown in desktop to.

1
  • 1
    As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Dec 27, 2021 at 20:15
0
  1. Create a folder named Desktop in home directory.
  2. Now press ctrl+h in home directory and find .config file.
  3. in .config file find "user-dirs.dirs" open it.
  4. you will find -> XDG_DESKTOP_DIR="$HOME/".
  5. Make it like -> XDG_DESKTOP_DIR="$HOME/Desktop"
  6. => Restart..

It worked for me.
My ubuntu version 22.04.1 LTS

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .