/* gcc pimp.c $(pkg-config --cflags --libs glib-2.0) */#include <glib.h>int main (void){ gchar *link_dest, *themedirname; gchar *index_filename; gchar *theme_name; GKeyFile *keyfile; link_dest = g_file_read_link ("/etc/hildon/theme", NULL); g_assert (link_dest); themedirname = g_path_get_basename (link_dest); g_print ("Theme dirname: %s\n", themedirname); g_free (themedirname); g_free (link_dest); index_filename = g_build_filename (G_DIR_SEPARATOR_S "etc", "hildon", "theme", "index.theme", NULL); keyfile = g_key_file_new (); g_assert (g_key_file_load_from_file (keyfile, index_filename, G_KEY_FILE_NONE, NULL)); theme_name = g_key_file_get_string (keyfile, "Desktop Entry", "Name", NULL); g_print ("Theme name: %s\n", theme_name ? theme_name : "bollocks"); g_free (theme_name); g_key_file_free (keyfile); return 0;}