/* The dbus method for binary client */
gboolean
deskmenu_control (Deskmenu *deskmenu, gchar *filename, gchar *workingd, GError  **error)
{
	if(chdir (workingd) == 0) {
		DeskmenuObject *dm_object = check_file_cache (deskmenu, g_strstrip(filename));
		deskmenu_show(dm_object, deskmenu, error);
		return TRUE;
	}
	return FALSE;
}
//precache backend, currently needs GUI
static void
deskmenu_precache (Deskmenu *deskmenu, gchar *filename)
{
	GError *error = NULL;
	GKeyFile *config = g_key_file_new ();
	guint i = 0;
	gsize total = 0;

	check_file_cache(deskmenu, ""); //always cache default menu

	g_print("Attempting to precache files in config...");
	if (!filename)
	{
		filename = g_build_path (G_DIR_SEPARATOR_S,
		                          g_get_user_config_dir (),
		                          "compiz",
		                          "boxmenu",
		                          "precache.ini",
		                          NULL);
	}
	if (!g_key_file_load_from_file (config, filename, G_KEY_FILE_NONE, NULL))
	{
		g_print("Configuration not found, will not precache files...");
	}
	else
	{
		g_print("Configuration found! Starting precache...");
		gchar **files = g_key_file_get_keys (config, "Files", &total, &error);
		gchar *feed = NULL;
		for (i = 0;i < total;i++)
		{
			feed = g_key_file_get_string (config, "Files", files[i], &error);
			if (feed)
			{
				check_file_cache(deskmenu, parse_expand_tilde(feed));
				g_free(feed);
			}
		}
		g_strfreev(files);
	}
	g_key_file_free (config);
}