prog to set gnome-config params




Hey there,

	This is a short, simple program to set configuration parameters
using the gnome-config setup.  You may find it useful for scripts & the
like; that's what I intended it for (automating installation more).  It's
not nearly clean enough for Real Packages, but at 449 bytes it's not exactly
a beast.  Hell, it's smaller than this message. ;-)

	Keep it if you like; burn it if you don't.  Same old, same old.

- Bibek
#include <glib.h>
#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-config.h>

int main( int argc, char *argv[] )
{
	gchar *hist;
	int i;
	
	if( argc < 2 ) {
		g_print( "usage: %s <gnome_config_path> <value>\n", argv[0] );
		return 1;
	}
	
	hist = gnome_config_get_string( argv[1] );
	
	g_print( "hist = %p, '%s'\n", hist, hist );
	
	if( argc == 3 ) {
		gnome_config_set_string( argv[1], argv[2] );
	}
	
	gnome_config_sync();
	
	return 0;
}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]