Active Topics

 


Reply
Thread Tools
Posts: 200 | Thanked: 44 times | Joined on Jan 2010
#1
Is there a gconf key or a file which i can read to determine which theme is enabled ?
 
qwerty12's Avatar
Posts: 4,274 | Thanked: 5,358 times | Joined on Sep 2007 @ Looking at y'all and sighing
#2
PHP Code:
/* 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 (keyfileindex_filenameG_KEY_FILE_NONENULL));
    
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;

It's not what you asked for, but maybe you'll be able to figure out the equivalent in Qt (GTK has the gtk-theme-name property in the GtkSettings object; maybe Qt has something similar).
 

The Following User Says Thank You to qwerty12 For This Useful Post:
Posts: 200 | Thanked: 44 times | Joined on Jan 2010
#3
So what i can take from that is etc/hildon/theme/index.theme is some type of link to the current theme loaded. So i basically have to work out a way to extract it from there or use it. Ok thank you very much had a feeling it would be in etc or a gconf setting.

cheers for taking your time to show me that it was very informative.
 

The Following User Says Thank You to jamie721 For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 10:25.