Score:1

Desktop now showing home folders / files. Solutions tried haven't worked

US flag

I'm new to Ubuntu and I'd just started to get to grips with 20.04 when my desktop suddenly started showing the home directory contents.

I've found a couple of possible solutions, but they haven't worked.

~/.config/user-dirs.dirs is showing XDG_DESKTOP_DIR="$HOME/"

I used

gedit ~/.config/user-dirs.dirs 

and edited the line to

XDG_DESKTOP_DIR="$HOME/Desktop"

It appears to save, but it's gone on a restart and the folders and files are still there. If I use sudo gedit, I receive dconf-Warning "dbus-launch" errors.

I also tried the Dconf Editor to go into the Nautilus preferences looking for desktop_is_home_dir but that line is not there.

Has anybody got any ideas, and be aware I am new to linux/Ubuntu?

If I enter

ls -l $HOME/Desktop

I get

lrwxrwxrwx 1 colin colin 19 Feb  7 16:03 /home/colin/Desktop -> /home/colin/Desktop
hr flag
Does `$HOME/Desktop` actually exist? what are its permission modes (`ls -l $HOME/Desktop`)?
punking avatar
md
It shows the following rwxrwxrwx 1 /home/colin/Desktop -> /home/colin/Desktop
hr flag
Please [edit] the `ls -l` output into your question so the formating doesn't go astray - it looks like you have somehow ended up with a recursive symbolic link?
punking avatar
md
Done. I'll have to read up on what a recursive symbolic link is.
punking avatar
md
If this link is what's causing the problem then I'm not sure how to remove it (I don't know how it occurred in the first place).
Score:1
hr flag

Likely what's happening is that xdg-user-dirs-update (which is run when you start a new desktop session) is noticing that $HOME/Desktop is not a directory, and is resetting the value of XDG_DESKTOP_DIR to your home directory instead, undoing your changes to the user-dirs.dirs file. From the man page:

If an old configuration exists it is updated with any new default
directories. Additionally, any configured directories that point to
non-existing locations are reset by pointing then to the users home
directory. This typically happens when the users removed the directory, so they likely don't want to use it anymore.

Since /home/colin/Desktop is a link to itself, you can just remove it and recreate it as a regular directory:

rm "$HOME/Desktop" && mkdir "$HOME/Desktop"

then make your changes to user-dirs.dirs. After that, they should be applied next time you log in.

punking avatar
md
That worked. Thank you for taking the time to help me.
hr flag
@punking happy to help
v1d3rm3 avatar
ru flag
My Desktop is turning into a symbolic link on restart.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.