RFC: Module path



Hi all,

I am looking for a convenient way to manage GTK+ themes in a network.
A sysadmin should be able to install themes in a number of different
directories. Also, users should be able to install and select their
own themes.

A theme can be selected by pointing ${HOME}/.gtkrc to the theme's
gtkrc file using a (sym)link or an appropriate include statement in
${HOME}/.gtkrc.

However, using themes with theme engines raises some problems. GTK+
needs to know where it has to look for the engine of the selected
theme (module_path).

Currently, GTK+ (1.2.8) sets up the module path in the following way:

1. Look for GTK_EXE_PREFIX in user's environment. If the variable is
   set, add ${GTK_EXE_PREFIX}/lib/gtk/themes/engines to search
   path. Continue with 3.

2. Add compile time GTK_EXE_PREFIX/lib/gtk/themes/engines to search
   path.

3. Add ${HOME}/.gtk/lib/themes/engines to search path.

4. Look for module_path statement in ${HOME}/.gtkrc and *set*
   (i.e. clear previous) module path.

Knowing this there are two possible ways to access theme engines:

1. Installation of theme engines in a directory that is in the default
   search path of GTK+ (see below).

   Drawbacks:

   - It would be nearly impossible for users to install their own
     engines.

   - A sysadmin would pollute the filesystem with local additions
     unless (s)he writes a rpm/deb/whatever package for every theme
     engine.

2. Putting a module_path entry in ${HOME}/.gtkrc before the include
   statement that reads the gtkrc of the selected theme.

   Drawbacks:

   - ${HOME}/.gtkrc can't be a link.

   - module_path directives override previous settings. No
     hierarchical configuration is possible.

   - If the sysadmin installs a new theme, the ${HOME}/.gtkrc files of
     all users would have to be updated. (Not everybody likes to learn
     cfengine's syntax ;-)

I think this is not as flexible as it could/should be and I would like
to propose the introduction of an environment variable that specifies
the module search path as colon separated list of directories to look
for engines. GTK+ should be modified to perform the following actions
to set up the module path:

1. Look for a variable GTK_MODULE_PATH in user's environment. This
   variable contains a colon separated list of directories. Add all
   these directories to the module path.

2. Look for module_path statement in ${HOME}/.gtkrc and set module
   path.

3. If module path is still empty, add compile time default
   GTK_EXE_PREFIX/lib/gtk/themes/engines.

Optionally I could think of a method to embed GTK_MODULE_PATH in
the string argument of the module_path statement via an empty list
element: 

  module_path "<path>::<anotherpath>"

would lead to a module path

  "<path>:${GTK_MODULE_PATH}:<anotherpath>


While I am suggesting new environment variables, I would also like to
propose the environment variable GTK_THEME_PATH as a standard search
path for themes. This variable would not necessarily be used by GTK+
itself but rather by theme manager applications, scanning all
directories in GTK_THEME_PATH and regarding all *sub*directory names
as theme names.

I would really appreciate comments on that.

Best regards,
	Marcus
-- 
	  Some operating systems are called `user friendly',
		  UNIX however is `expert friendly'.

	   Marcus Harnisch <mailto:marcus.harnisch@gmx.net>





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