Why the Gnome/GTK Icon Silliness? [SOLVED]
Posted: 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.
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.