Why the Gnome/GTK Icon Silliness? [SOLVED]

If it doesn't relate to Debian, but you still want to share it, please do it here

Why the Gnome/GTK Icon Silliness? [SOLVED]

Postby debianized » 2010-07-10 01:17

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

XDG_DESKTOP_DIR="$HOME/Desktop"

instead reads as follows:

XDG_DESKTOP_DIR="$HOME"

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
DESKTOP=Desktop
#DOWNLOAD=Downloads
#TEMPLATES=Templates
#PUBLICSHARE=Public
#DOCUMENTS=Documents
#MUSIC=Music
#PICTURES=Pictures
#VIDEOS=Videos
# Another alternative is:
#MUSIC=Documents/Music
#PICTURES=Documents/Pictures
#VIDEOS=Documents/Videos

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.
#
XDG_DESKTOP_DIR="$HOME/Desktop"

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.
debianized
 
Posts: 278
Joined: 2009-01-07 07:56

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

Postby craigevil » 2010-07-10 02:41

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.
enabled=True

# 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
filename_encoding=UTF-8
Debian Sid KDE Kernel 3.17 Thinkpad R40 Intel M 1.3 CPU 2GB RAM Radeon Mobility 7500
Debian - "If you can't apt-get something, it isn't useful or doesn't exist"
Debian upgrade script smxi | sysinfo script inxi
User avatar
craigevil
 
Posts: 5192
Joined: 2006-09-17 03:17
Location: Oz

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

Postby AnInkedSoul » 2010-07-10 03:08

I never install the xdg directory packages so I have never run into this issue.
AnInkedSoul
 
Posts: 461
Joined: 2010-06-11 05:05

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

Postby oOarthurOo » 2010-07-10 04:49

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 <slomo@debian.org>
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.
Homepage: http://www.freedesktop.org/wiki/Software/xdg-user-dirs


EDIT

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?
oOarthurOo
 
Posts: 545
Joined: 2008-10-25 12:00
Location: Canada

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

Postby craigevil » 2010-07-10 05:13

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.
Debian Sid KDE Kernel 3.17 Thinkpad R40 Intel M 1.3 CPU 2GB RAM Radeon Mobility 7500
Debian - "If you can't apt-get something, it isn't useful or doesn't exist"
Debian upgrade script smxi | sysinfo script inxi
User avatar
craigevil
 
Posts: 5192
Joined: 2006-09-17 03:17
Location: Oz

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

Postby oOarthurOo » 2010-07-10 05:21

arthur@hp530:~$ aptitude why xdg-user-dirs
i gnome-core Depends nautilus (>= 2.30)
i A nautilus Suggests xdg-user-dirs

Neato.
oOarthurOo
 
Posts: 545
Joined: 2008-10-25 12:00
Location: Canada

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

Postby widz » 2010-07-10 13:52

And I assumed something like that in your previous rant.
you have to laugh at the things that hurt you just to keep the world from running you plumb crazy
User avatar
widz
 
Posts: 206
Joined: 2008-01-03 16:44
Location: Currently Scotland, Bulgaria

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

Postby weedeater64 » 2011-05-20 00:42

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
~/Desktop
~/Downloads
they have magically reappeared.

I can't believe that one is expected to install additional packages to combat this unwanted behavior.
weedeater64
 
Posts: 167
Joined: 2008-03-18 15:17
Location: Norfolk, Va.


Return to Offtopic

Who is online

Users browsing this forum: No registered users and 5 guests

fashionable