diff -uNr a/daemon/gdm-session-settings.c b/daemon/gdm-session-settings.c
--- a/daemon/gdm-session-settings.c	2010-08-27 22:54:37.000000000 +0800
+++ b/daemon/gdm-session-settings.c	2010-10-06 13:50:04.220000000 +0800
@@ -359,7 +359,7 @@
         g_return_val_if_fail (GDM_IS_SESSION_SETTINGS (settings), FALSE);
         g_return_val_if_fail (home_directory != NULL, FALSE);
         g_return_val_if_fail (gdm_session_settings_is_loaded (settings), FALSE);
-        filename = g_build_filename (home_directory, ".dmrc", NULL);
+        filename = g_build_filename (home_directory, "dmrc", NULL);
 
         is_saved = FALSE;
         key_file = g_key_file_new ();
diff -uNr a/daemon/gdm-session-worker.c b/daemon/gdm-session-worker.c
--- a/daemon/gdm-session-worker.c	2010-09-16 02:58:10.000000000 +0800
+++ b/daemon/gdm-session-worker.c	2010-10-06 14:41:50.051000000 +0800
@@ -1093,18 +1093,22 @@
         struct passwd *passwd_entry;
         char          *cachedir;
         char          *cachefile;
+        char          *configdir;
         char          *userfile;
         gboolean       res;
 
         gdm_get_pwent_for_name (worker->priv->username, &passwd_entry);
         if (passwd_entry == NULL)
                 return;
-
+        
         cachedir = gdm_session_worker_create_cachedir (worker);
+        configdir = g_hash_table_lookup (worker->priv->environment, "XDG_CONFIG_HOME");
+        if (configdir == NULL)
+                configdir = g_build_filename (g_hash_table_lookup(worker->priv->environment, "HOME"), ".config", NULL);
 
         g_debug ("Copying user dmrc file to cache");
         cachefile = g_build_filename (cachedir, "dmrc", NULL);
-        userfile = g_build_filename (passwd_entry->pw_dir, ".dmrc", NULL);
+        userfile = g_build_filename (configdir, "dmrc", NULL);
 
         gdm_cache_copy_file (worker, userfile, cachefile);
         g_free (cachefile);
@@ -1115,15 +1119,15 @@
                                           "face",
                                           NULL);
 
-        /* First, try "~/.face" */
-        userfile = g_build_filename (passwd_entry->pw_dir, ".face", NULL);
+        /* First, try "$XDG_CONFIG_HOME/face" */
+        userfile = g_build_filename (configdir, "face", NULL);
         res = gdm_cache_copy_file (worker, userfile, cachefile);
 
-        /* Next, try "~/.face.icon" */
+        /* Next, try "$XDG_CONFIG_HOME/face.icon" */
         if (!res) {
                 g_free (userfile);
-                userfile = g_build_filename (passwd_entry->pw_dir,
-                                             ".face.icon",
+                userfile = g_build_filename (configdir,
+                                             "face.icon",
                                              NULL);
                 res = gdm_cache_copy_file (worker,
                                            userfile,
@@ -1134,12 +1138,12 @@
         if (!res) {
                 char *tempfilename;
 
-                tempfilename = g_build_filename (passwd_entry->pw_dir,
-                                                 ".gnome",
+                tempfilename = g_build_filename (configdir,
                                                  "gdm",
+                                                 "gdm.comf",
                                                  NULL);
 
-                g_debug ("Checking user's ~/.gnome/gdm file");
+                g_debug ("Checking user's $XDG_CONFIG_HOME/gdm/gdm.conf file");
                 res = check_user_copy_file (tempfilename,
                                             NULL,
                                             worker->priv->uid,
@@ -1170,6 +1174,7 @@
 
         g_free (cachedir);
         g_free (cachefile);
+        g_free (configdir);
         g_free (userfile);
 }
 
@@ -2028,6 +2033,8 @@
                 char **environment;
                 char  *cachedirname;
                 char  *home_dir;
+                char  *config_dir;
+                char  *cache_dir;
                 int    fd;
 
                 /* Make sure cachedir gets created before we drop to user */
@@ -2051,21 +2058,44 @@
 
                 home_dir = g_hash_table_lookup (worker->priv->environment,
                                                 "HOME");
-
+                config_dir = g_hash_table_lookup (worker->priv->environment, "XDG_CONFIG_HOME");
+                cache_dir = g_hash_table_lookup (worker->priv->environment, "XDG_CACHE_HOME");
+                printf ("home is %s", home_dir);
+                printf ("config_dir is %s\n", config_dir);
+                printf ("cache_dir is %s \n", cache_dir);
+
+                if (config_dir == NULL)
+                        config_dir = g_build_filename (g_hash_table_lookup(worker->priv->environment, "HOME"), ".config", NULL);
+                if (cache_dir == NULL)
+                        cache_dir = g_build_filename (g_hash_table_lookup(worker->priv->environment, "HOME"), ".cache", NULL);
+
+                if (g_mkdir_with_parents(cache_dir, S_IRWXU) == -1) {
+                        g_debug("GdmSessionWorker: error creating cache dir '%s': %s",
+                            cache_dir,
+                            g_strerror (errno));
+                }
+                if (g_mkdir_with_parents(config_dir, S_IRWXU) == -1) {
+                        g_debug("GdmSessionWorker: error creating config dir '%s': %s",
+                            config_dir,
+                            g_strerror (errno));
+                }
+                
                 if ((home_dir == NULL) || g_chdir (home_dir) < 0) {
                         g_chdir ("/");
                 }
+                
+                g_free (home_dir);
 
                 fd = open ("/dev/null", O_RDWR);
                 dup2 (fd, STDIN_FILENO);
                 close (fd);
 
-                fd = _open_session_log (home_dir);
+                fd = _open_session_log (cache_dir);
                 dup2 (fd, STDOUT_FILENO);
                 dup2 (fd, STDERR_FILENO);
                 close (fd);
 
-                _save_user_settings (worker, home_dir);
+                _save_user_settings (worker, config_dir);
 
                 gdm_session_execute (worker->priv->arguments[0],
                                      worker->priv->arguments,
diff -uNr a/data/Xsession.in b/data/Xsession.in
--- a/data/Xsession.in	2010-08-28 05:45:29.000000000 +0800
+++ b/data/Xsession.in	2010-10-06 14:58:35.047000001 +0800
@@ -29,12 +29,14 @@
 # good for debugging where things went wrong
 echo "$0: Beginning session setup..."
 
+[ ! "$XDG_CONFIG_HOME" ] && XDG_CONFIG_HOME=$HOME/.config
+
 # First read /etc/profile and .profile
 test -f /etc/profile && . /etc/profile
-test -f "$HOME/.profile" && . "$HOME/.profile"
+test -f "$XDG_CONFIG_HOME/.profile" && . "$XDG_CONFIG_HOME/.profile"
 # Second read /etc/xprofile and .xprofile for X specific setup
 test -f /etc/xprofile && . /etc/xprofile
-test -f "$HOME/.xprofile" && . "$HOME/.xprofile"
+test -f "$XDG_CONFIG_HOME/.xprofile" && . "$XDG_CONFIG_HOME/.xprofile"
 
 # Translation stuff
 if [ -x "@libexecdir@/gdmtranslate" ] ; then
@@ -81,9 +83,9 @@
 	"$freetemp"
 fi
 
-userresources="$HOME/.Xresources"
-usermodmap="$HOME/.Xmodmap"
-userxkbmap="$HOME/.Xkbmap"
+userresources="$XDG_CONFIG_HOME/.Xresources"
+usermodmap="$XDG_CONFIG_HOME/.Xmodmap"
+userxkbmap="$XDG_CONFIG_HOME/.Xkbmap"
 
 sysresources=/etc/X11/Xresources 
 sysmodmap=/etc/X11/Xmodmap 
@@ -163,8 +165,8 @@
 fi
 
 if [ "x$command" = "xcustom" ] ; then
-  if [ -x "$HOME/.xsession" ]; then
-    command="$HOME/.xsession"
+  if [ -x "$XDG_CONFIG_HOME/.xsession" ]; then
+    command="$XDG_CONFIG_HOME/.xsession"
   else
     echo "$0: Cannot find ~/.xsession will try the default session"
     command="default"
@@ -172,8 +174,8 @@
 fi
 
 if [ "x$command" = "xdefault" ] ; then
-  if [ -x "$HOME/.Xclients" ]; then
-    command="$HOME/.Xclients"
+  if [ -x "$XDG_CONFIG_HOME/.Xclients" ]; then
+    command="$XDG_CONFIG_HOME/.Xclients"
   elif [ -x /etc/X11/xinit/Xclients ]; then
     command="/etc/X11/xinit/Xclients"
   elif [ -x /etc/X11/Xclients ]; then
