You are not logged in.

#1 2006-12-10 17:47:25

Kindred
Member
From: Australia
Registered: 2006-03-25
Posts: 27

General (noob) question regarding config files (mostly)

This question is simply a result of never doing any real world programming, and lack of understanding.

So I have been wanting to write a GTK theme switch GUI thing for some time now (to allow easy switching of theme, icons, maybe fonts etc), I read a couple of python books and now i've messed around with PyGTK a bit and finally got around to wanting to do this but realised I really don't understand how this should work.  But this is more of a general question than anything specific. 

So, basically, editing a path to a different theme in ~/.gtkrc-2.0 and then restarting X or doing something else (gtk-chtheme and others can switch theme without restarting X.. one of many things i'll have to figure out I guess) will switch theme, so...

Would I be looking to modify the config file through the GUI with various string techniques and then call this restart procedure (eh, this sounds too easy) or is it more of a case of calling various GTK functions and whatever to give it the theme, the config file simply being updated as a result?

Weird/stupid question probably but i'd very much appreciate any insight on how this config thing works..  smile

Offline

#2 2006-12-10 19:49:16

stonecrest
Member
From: Boulder
Registered: 2005-01-22
Posts: 1,190

Re: General (noob) question regarding config files (mostly)

Kindred wrote:

Would I be looking to modify the config file through the GUI with various string techniques and then call this restart procedure (eh, this sounds too easy) or is it more of a case of calling various GTK functions and whatever to give it the theme, the config file simply being updated as a result?

The former is correct.


I am a gated community.

Offline

#3 2006-12-11 04:35:23

pauldonnelly
Member
Registered: 2006-06-19
Posts: 776

Re: General (noob) question regarding config files (mostly)

You won't need to restart X. After changing the theme, the changes should be in effect for newly opened applications. I'm not sure what's needed to tell the others to update.

Offline

#4 2006-12-11 11:48:50

Kindred
Member
From: Australia
Registered: 2006-03-25
Posts: 27

Re: General (noob) question regarding config files (mostly)

Hey thanks, I was kind of second guessing myself there. 

Yeah I don't know how to update the theme, all part of the fun though.

Offline

#5 2006-12-13 14:45:51

Kindred
Member
From: Australia
Registered: 2006-03-25
Posts: 27

Re: General (noob) question regarding config files (mostly)

Seems pygtk doesn't have the bindings to do what is needed to update all existing windows  (gdk_event_send_clientmessage_toall & others), at least as far as I can see.  I imagine C extensions would be what is needed but doesn't give me much faith in doing this in python if the first minor thing I need to do requires C..

Offline

#6 2006-12-13 16:56:42

skymt
Member
Registered: 2006-11-27
Posts: 443

Re: General (noob) question regarding config files (mostly)

Try using python-ctypes. It allows you to (among other things) access C library functions from Python.

Offline

#7 2006-12-13 22:54:00

pelle.k
Member
From: Åre, Sweden (EU)
Registered: 2006-04-30
Posts: 667

Re: General (noob) question regarding config files (mostly)

You do know that there's both gtk-chtheme and switch2 in the repos right? I guess you do this for fun (and learning) anyways. Just thought i'd... well, let you know smile


"Your beliefs can be like fences that surround you.
You must first see them or you will not even realize that you are not free, simply because you will not see beyond the fences.
They will represent the boundaries of your experience."

SETH / Jane Roberts

Offline

Board footer

Powered by FluxBB