--- gnome-settings-daemon-2.22.0/gnome-settings-daemon/main.c.orig	2008-05-04 13:45:05.688229000 +0800
+++ gnome-settings-daemon-2.22.0/gnome-settings-daemon/main.c	2008-05-04 13:36:07.100542000 +0800
@@ -26,6 +26,7 @@
 #include <locale.h>
 
 #include <glib/gi18n.h>
+#include <glib/gstdio.h>
 #include <gtk/gtk.h>
 #include <libgnome/libgnome.h>
 
@@ -191,6 +192,7 @@
         GnomeProgram         *program;
         gboolean              res;
         GError               *error;
+        gboolean              create_dirs = TRUE;
 
         manager = NULL;
         program = NULL;
@@ -224,12 +226,22 @@
                 goto out;
         }
 
+        /*
+         * If the user does not have a writable HOME directory, then
+         * init libgnome with appropriate arguments to run without
+         * needing one.
+         */
+        if (g_getenv ("GNOME22_USER_DIR") == NULL && g_access (g_get_home_dir(), W_OK) != 0)
+           create_dirs = FALSE;
+
         program = gnome_program_init (PACKAGE,
                                       VERSION,
                                       LIBGNOME_MODULE,
                                       argc,
                                       argv,
-                                      GNOME_PARAM_NONE);
+                                      GNOME_PARAM_CREATE_DIRECTORIES,
+                                      create_dirs,
+                                      NULL);
 
         manager = gnome_settings_manager_new ();
         if (manager == NULL) {
--- gnome-settings-daemon-2.22.0/plugins/font/gsd-font-manager.c.orig	2008-05-04 13:18:33.843191000 +0800
+++ gnome-settings-daemon-2.22.0/plugins/font/gsd-font-manager.c	2008-05-04 13:39:58.621593000 +0800
@@ -40,6 +40,7 @@
 #include <gtk/gtk.h>
 #include <gconf/gconf.h>
 #include <gconf/gconf-client.h>
+#include <libgnome/libgnome.h>
 
 #include "gsd-font-manager.h"
 #include "delayed-dialog.h"
@@ -196,7 +197,7 @@
         char          *mkfontdir_cmd;
 
         /* setting up the dir */
-        font_dir_name = g_build_path (G_DIR_SEPARATOR_S, g_get_home_dir (), ".gnome2/share/fonts", NULL);
+        font_dir_name = g_build_path (G_DIR_SEPARATOR_S, gnome_user_dir_get (), "share/fonts", NULL);
         if (! g_file_test (font_dir_name, G_FILE_TEST_EXISTS)) {
                 if (g_mkdir_with_parents (font_dir_name, 0755) != 0) {
                         GtkWidget *dialog;
@@ -219,7 +220,7 @@
                 }
         }
 
-        dir_name = g_build_path (G_DIR_SEPARATOR_S, g_get_home_dir (), ".gnome2/share/cursor-fonts", NULL);
+        dir_name = g_build_path (G_DIR_SEPARATOR_S, gnome_user_dir_get (), "share/cursor-fonts", NULL);
         if (! g_file_test (dir_name, G_FILE_TEST_EXISTS)) {
                 if (g_mkdir_with_parents (dir_name, 0755) != 0) {
                         GtkWidget *dialog;
--- gnome-settings-daemon-2.22.0/plugins/sound/libsounds/sound-properties.c.orig	2008-05-04 13:21:32.891049000 +0800
+++ gnome-settings-daemon-2.22.0/plugins/sound/libsounds/sound-properties.c	2008-05-04 13:37:22.928163000 +0800
@@ -593,7 +593,7 @@
 	
 	g_return_if_fail (SOUND_IS_PROPERTIES (props));
 
-	directory = gnome_util_home_file (NULL);
+	directory = gnome_user_dir_get ();
 	directory[strlen (directory) - 1] = '\0';
 	sound_properties_save (props, directory, FALSE);
 	g_free (directory);
--- gnome-settings-daemon-2.22.0/plugins/xrdb/gsd-xrdb-manager.c.orig	2008-05-04 13:47:31.968226000 +0800
+++ gnome-settings-daemon-2.22.0/plugins/xrdb/gsd-xrdb-manager.c	2008-05-04 13:30:16.248612000 +0800
@@ -43,7 +43,7 @@
 
 #define SYSTEM_AD_DIR    DATADIR "/xrdb"
 #define GENERAL_AD       SYSTEM_AD_DIR "/General.ad"
-#define USER_AD_DIR      ".gnome2/xrdb"
+#define USER_AD_DIR      "xrdb"
 #define USER_X_RESOURCES ".Xresources"
 #define USER_X_DEFAULTS  ".Xdefaults"
 
@@ -232,7 +232,7 @@
                 return NULL;
         }
 
-        home_dir = g_get_home_dir ();
+        home_dir = gnome_user_dir_get ();
         if (home_dir != NULL) {
                 char *user_ad;
 
