Page 1 of 1

Why the Gnome/GTK Icon Silliness? [SOLVED]

PostPosted: 2010-07-10 01:17
by debianized
The problem is solved. It was an xdg issue, with the decision being forced on the user by the distribution. I know at least Ubuntu and PCLinuxOS are doing this on fresh installs. A default set of folders is created at install (Documents, Public, Templates, Music, Videos, etc), which is odd, since it seems these distros are assuming every install is a fresh install and that a user might never have a back up of their home and thus, would not need these extra folders to be created. What caused every folder and file to appear on the desktop is the following line found in both /etc/xdg/users-dirs.defaults AND in /home/username/.config/user-dirs.dirs. If the line which should show


instead reads as follows:


Then every folder and file in your home folder will appear on the desktop. The solution was hardly obvious, but I was able to track it down after looking at the /home/username/.config folder

Here is the solution;

To prevent xdg from creating totally useless and unnecessary folders every time you login, do the following:

1. Edit /etc/xdg/users-dirs.defaults such that it reads as follows:

# Default settings for user directories
# The values are relative pathnames from the home directory and
# will be translated on a per-path-element basis into the users locale
# Another alternative is:

2. Edit /home/username/.config/user-dirs.dirs so that it reads as follows:

# This file is written by xdg-user-dirs-update
# If you want to change or add directories, just edit the line you're
# interested in. All local changes will be retained on the next run
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
# absolute path. No other format is supported.

3. Log out and into your account as often as you wish and you will no longer have unnecessary, useless and unwanted folders appearing in your home directory.

Strangest of all, even if you chown root.root user-dirs.dirs in your home/.configs and then chmod 400 user-dirs.dirs, then log out and log back in, that file will still be overwritten, your username will own it again and the permissions will revert back to rw, which means every folder listed in the file will be recreated at every login. There is no way to fix it without editing the /etc/xdg defaults. And as long as XDG_DESKTOP_DIR="$HOME/Desktop" exists in your home/.config every folder and file in your home will not appear on the desktop.

Re: Why the Gnome/GTK Icon Silliness? [SOLVED]

PostPosted: 2010-07-10 02:41
by craigevil
Actually all you need to do is edit /etc/xdg/user-dirs.conf or on lxde remove it from the .config/autostart dir

# This controls the behaviour of xdg-user-dirs-update which is run on user login
# You can also have per-user config in ~/.config/user-dirs.conf, or specify
# the XDG_CONFIG_HOME and/or XDG_CONFIG_DIRS to override this
Change this line from true to false, then the folders do not magically reappear at every login.

# This sets the filename encoding to use. You can specify an explicit
# encoding, or "locale" which means the encoding of the users locale
# will be used

Re: Why the Gnome/GTK Icon Silliness? [SOLVED]

PostPosted: 2010-07-10 03:08
by AnInkedSoul
I never install the xdg directory packages so I have never run into this issue.

Re: Why the Gnome/GTK Icon Silliness? [SOLVED]

PostPosted: 2010-07-10 04:49
by oOarthurOo
I just did a fresh install of Debian Squeeze, using daily build netinst, and chose Desktop from tasksel during install. Nothing like what you describe occurs. The only folders on the desktop were my user's /home, /computer and /trash. Media show up to if you plug them in.

And it appears that xdg-user-dirs is installed by default, because I haven't installed anything yet, except for flashplugin-nonfree.
arthur@hp530:~$ aptitude show xdg-user-dirs
Package: xdg-user-dirs
State: installed
Automatically installed: no
Version: 0.12-1
Priority: optional
Section: utils
Maintainer: Sebastian Dröge <>
Uncompressed Size: 774k
Depends: libc6 (>= 2.2)
Description: tool to manage well known user directories
xdg-user-dirs is a tool to help manage "well known" user directories like the
desktop folder and the music folder. It also handles localization (i.e.
translation) of the filenames.

The way it works is that xdg-user-dirs-update is run very early in the login
phase. This program reads a configuration file, and a set of default
directories. It then creates localized versions of these directories in the
users home directory and sets up a config file in
$(XDG_CONFIG_HOME)/user-dirs.dirs (XDG_CONFIG_HOME defaults to ~/.config) that
applications can read to find these directories.


Oh, I see we've edited our first post now. Well, that non-sense still doesn't show up on the desktop, but yes, folders like Documents and Templates will be created if they don't exist. I've deleted my Template folder that was automagically created however, and after a restart it hasn't magically reappeared.

What version of Debian and xdg-user-dirs are you running?

Re: Why the Gnome/GTK Icon Silliness? [SOLVED]

PostPosted: 2010-07-10 05:13
by craigevil
aptitude why xdg-user-dirs
Code: Select all
i   xinit         Recommends xterm | x-session-manager | x-window-manager | x-terminal-emulator                                   
p   xfce4-session Provides   x-session-manager                                 
p   xfce4-session Recommends xfdesktop4                                         
p   xfdesktop4    Recommends xdg-user-dirs

aptitude why xdg-user-dirs
i xdg-user-dirs-gtk Depends xdg-user-dirs

Seems xdg-user-dirs is not really needed for any package other than xdg-user-dirs-gtk.

BTW once you delete the folders they do not come back, or at least they don't from I have seen.

Re: Why the Gnome/GTK Icon Silliness? [SOLVED]

PostPosted: 2010-07-10 05:21
by oOarthurOo
arthur@hp530:~$ aptitude why xdg-user-dirs
i gnome-core Depends nautilus (>= 2.30)
i A nautilus Suggests xdg-user-dirs


Re: Why the Gnome/GTK Icon Silliness? [SOLVED]

PostPosted: 2010-07-10 13:52
by widz
And I assumed something like that in your previous rant.

Re: Why the Gnome/GTK Icon Silliness? [SOLVED]

PostPosted: 2011-05-20 00:42
by weedeater64
Following advise of 'some' people here, I searched for this problem before posting.

Well I don't have and 'xdg' packages,

~$ dpkg --get-selections | grep xdg

Yet after deleting both
they have magically reappeared.

I can't believe that one is expected to install additional packages to combat this unwanted behavior.