20

Recently I deleted the folder Desktop from my $HOME directory. When I logged in again all files and directories in $HOME were shown on the desktop. So I wanted to get the folder back. What is the recommended way to achieve this? I edited ~/.config/xdg-user-dirs.dir and added the correct variable. But I guess there must be some other (more easy?) way.

1
  • 1
    install ubuntu tweak 0.5, there is a Section under "Desktop" category called "Desktop icon settings",simply uncheck the "Show content of home folder on desktop..." and logout
    – Prasad RD
    Mar 27, 2012 at 0:57

4 Answers 4

42
+50
  1. Create a new folder that you want to use as your folder.

    For example, type mkdir ~/Desktop in a terminal (Ctrl+Alt+T to open one) to create a folder named Desktop in your home directory.

  2. Edit your configuration.

    Edit the file ~/.config/user-dirs.dirs. You can do this by opening a terminal, then enter:

    gedit ~/.config/user-dirs.dirs
    

    Change the entry for XDG_DESKTOP_DIR to your new desktop folder, or add it, if the entry does not exist. After your edit, the file should look like this:

    XDG_DESKTOP_DIR="$HOME/Desktop"  
    XDG_DOWNLOAD_DIR="$HOME/Download"  
    XDG_TEMPLATES_DIR="$HOME/Templates"  
    XDG_PUBLICSHARE_DIR="$HOME/Public"  
    XDG_DOCUMENTS_DIR="$HOME/Documents"  
    XDG_MUSIC_DIR="$HOME/Music"  
    XDG_PICTURES_DIR="$HOME/Pictures"  
    XDG_VIDEOS_DIR="$HOME/Videos"
    
  3. Log out and then log in again and your desktop should show the specified folder.

1
  • If you don't want to logout the following appears to work in gnome-shell/nautilus (tested in Centos 7) after modifying the file. nautilus -q && nautilus & Here's another [question][1] for reference. [1]:askubuntu.com/questions/19979/… Dec 6, 2016 at 16:43
4

You can use xdg-user-dirs-update command to set Desktop.

 xdg-user-dirs-update --set DESKTOP $HOME/NewDesktop

But at first check out your locale names

 cat  ~/.config/user-dirs.dirs

For English locale they are:

 XDG_DESKTOP_DIR="$HOME/Desktop"
 XDG_DOCUMENTS_DIR="$HOME/Documents"
 XDG_DOWNLOAD_DIR="$HOME/Downloads"
 XDG_MUSIC_DIR="$HOME/Music"
 XDG_PICTURES_DIR="$HOME/Pictures"
 XDG_PUBLICSHARE_DIR="$HOME/Public"
 XDG_TEMPLATES_DIR="$HOME/Templates"
 XDG_VIDEOS_DIR="$HOME/Videos"

You can set any of the above

 xdg-user-dirs-update --set DOWNLOAD ~/Internet

in order for the changes to take effect nautilus -q.

For more info check out https://wiki.archlinux.org/index.php/XDG_user_directories

1

In my case after updating gedit ~/.config/user-dirs.dirs was not worked. Because there was as symbolic link '../Desktop' in system and that had been broken (i think after update). I simply deleted that symbolic link and created new directory and edited gedit ~/.config/user-dirs.dirs

0

Just create an new folder with the name Desktop.

3
  • I forgot to mention this. This was my first try and it didn't work. Logged out of my GNOME session and after logging in again I had all icons on the screen as before (plus the new Desktop folder).
    – qbi
    Mar 27, 2012 at 7:34
  • 1
    @qbi: And what if you add a folder named 'Desktop', but in your native language? GNOME likes to play around with translated folder names. Mar 27, 2012 at 20:40
  • This I took for granted.
    – qbi
    Mar 28, 2012 at 8:42

You must log in to answer this question.

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