--- a/src/main.c
+++ b/src/main.c
@@ -272,37 +272,57 @@
     }
 }
 
+static gboolean
+filer_run(const char *command, const char *mount_point, GError **error)
+{
+    char *full_command = strstr(command, "%s") ?
+            g_strdup_printf(command, mount_point) :
+            g_strdup_printf("%s %s", command, mount_point);
+    gboolean result = g_spawn_command_line_async(full_command, error);
+    
+    g_free(full_command);
+    return result;
+}
+
 static void
 filer_open(AddedDeviceData *add, const char *mount_point)
 {
-    const char *args[3];
     GError *error = NULL;
-
-    add->open_when_mounted = FALSE;
-    args[0] = "rox";
-    args[1] = mount_point;
-    args[2] = NULL;
-    if (!g_spawn_async(NULL, (char **) args, NULL, G_SPAWN_SEARCH_PATH,
-            NULL, NULL, NULL, &error))
+    char *command = gconf_client_get_string(gconf_client_get_default(),
+            "/apps/rox-media/filer_open_command", &error);
+    
+    if (!command && !error)
+        command = g_strdup("rox");
+    if (command && !command[0])
+    {
+        g_free(command);
+        command = g_strdup("rox");
+    }
+
+    if (error || !filer_run(command, mount_point, &error))
     {
         dialog_error(icon_group_get_window(add->media->group), 0,
-                _("Unable to run rox to view mount point '%s': %s"),
+                _("Unable to open mount point '%s': %s"),
                 mount_point, error->message);
         g_error_free(error);
     }
+    g_free(command);
 }
 
 static void
 filer_close(const char *dir)
 {
-    const char *args[4];
-
-    args[0] = "rox";
-    args[1] = "-D";
-    args[2] = dir;
-    args[3] = NULL;
-    g_spawn_async(NULL, (char **) args, NULL, G_SPAWN_SEARCH_PATH,
-            NULL, NULL, NULL, NULL);
+    GError *error = NULL;
+    char *command = gconf_client_get_string(gconf_client_get_default(),
+            "/apps/rox-media/filer_close_command", &error);
+    
+    if (!command && !error)
+        command = g_strdup("rox -D");
+    if (command && command[0])
+        filer_run(command, mount_point, NULL);
+    if (error)
+        g_error_free(error);
+    g_free(command);
 }
 
 static void