Re: A First Gnome Application



Il giorno mar, 28/02/2006 alle 09.57 +0100, MARZULLO Laurent Ext DF/DCGC
ha scritto:
> 
> Hello all,
>  
> I'm really new to Gnome programming and I want to develop a gnome
> application which
> Will change the desktop background every 'n' minutes.
> 
> I was thinking of developping 2 things:
> 	1) A configuration tool: gnome-wallpaper-config
> 	2) A process (some kind of daemon) which will change the
> background every
> 	   n minutes.
> 
> My questions are:
> 	1) How may I overide the gnome application to change the
> background to 
> 	my 'gnome-wallpaper-config' ? i.e. When I right click on the
> desktop and
> 	select 'Change Desktop Background' or by selecting in the menu:
> 	Desktop -> Preferences -> Desktop Background, I would like that
> my new
> 	application instead of the default one to be launch.
> 
> 	2) What kind of gnome component should be the process that will
> change
> 	the desktop background ? Bonobo component ? Applet ? Simple unix
> process ?
> 	Because I would like this component to be launch at log time ?
> 
> 	I was thinking of developping a simple unix process that react
> with gconf
> 	and receive callback from gconf to detect configuration change.
> But how
> 	to start this process automatically ?
> 

That's not actually needed. If you use Python it's just a 50-row program
with 40 lines. You just have to interact with the
GConf /desktop/gnome/background/picture_filename key. The only issue
that could increase the lines is the tool to select from a list of
backgrounds.
Also you may want to monitor the list if files get removed. Otherwise
you just use the list that gnome-background-properties uses (which could
actually be a good idea). It's located in ~/.gnome2/backgrounds.xml.
So, my guess is that your program should have:
A) a daemon that has a callback that every N minutes changes the
background and every N minutes - 10 seconds or so parses the xml file to
get the list of the backgrounds (remember that files may be deleted, so,
if you don't want to mess with inotify and such this can be a good diy
way) :)
B) A configuration tool with a gconf backend that stores the delay.

Hope this helps.

Marco

> Thanks all
> 
>  
> Marzullo Laurent
> 

Attachment: signature.asc
Description: Questa parte del messaggio =?ISO-8859-1?Q?=E8?= firmata



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