EWL has been using the ecore_config subsystem to handle all of its configuration tasks. I converted it over to ecore_config fairly soon after its appearance in CVS. The way EWL worked was to hook into what is called the _system portion of ecore_config so that its configuration wouldn’t show up if an application was also using ecore_config.

Now, while this seemed like a good idea at the time, the tool to edit the _system data for EWL, examine, has been busted for quite a while. Meaning, we can’t change any default values in EWL. We have some command line options but there limited.

So, I ripped it out. It doesn’t work, so we don’t use it. In its place we have a simple system to use plain text key/value pair files. There is a system configuration file in @PACKAGE_DATA_DIR@/ewl/config/ewl.cfg that contains all of the possible keys.

# Ewl default configuration file.

#/ewl/debug/enable = 0
#/ewl/debug/level = 0
#/ewl/debug/segv = 0
#/ewl/debug/backtrace = 0
#/ewl/debug/evas/render = 0
#/ewl/debug/gc/reap = 0
#/ewl/theme/print/keys = 0
#/ewl/theme/print/signals = 0

/ewl/cache/evas/font = 2097152
/ewl/cache/evas/image = 8388608

/ewl/engine/name = evas_software_x11

/ewl/theme/name = e17
/ewl/theme/icon/theme = Tango
/ewl/theme/icon/size = 22x22

#/ewl/theme/color/classes/override = 0
#/ewl/theme/color/classes/count = 0
#/ewl/theme/color/classes/0/name = class_name
#/ewl/theme/color/classes/0/r/1 = 255
#/ewl/theme/color/classes/0/g/1 = 128
#/ewl/theme/color/classes/0/b/1 = 255
#/ewl/theme/color/classes/0/r/2 = 255
#/ewl/theme/color/classes/0/g/2 = 128
#/ewl/theme/color/classes/0/b/2 = 255
#/ewl/theme/color/classes/0/r/3 = 255
#/ewl/theme/color/classes/0/g/3 = 128
#/ewl/theme/color/classes/0/b/3 = 255

Anything beginning with a # is a comment. So we’re really only using 6 keys out of that file.

Along with the system config each user can have their own overrides in ~/.ewl/config/ewl.cfg.

The content of these files can be configured with the ewl_config command, or edited by hand if desired. ewl_config can either be used from the command line using the -set and -get flags or in GUI mode. If you run ewl_config as root, or someone with permissions to write the system file, you’ll be able to set the system configuration.

The ewl_config code can also handle application configuration. By calling Ewl_Config *ewl_config_new(const char *app_name) you’ll be able to set and get configuration for your application. This will work with user, system and command line configuration. If you need to save the system configuration there is a int ewl_config_can_save_system(Ewl_Config *cfg) that returns TRUE if possible, FALSE otherwise.

Application configuration will be stored in @PACKAGE_DATA_DIR@/ewl/config/apps/app_name.cfg and ~/.ewl/config/apps/app_name.cfg for system and user respectively.

The final piece to be completed for the ewl_config code in EWL is to to hook it into ecore_dbus to send messages when the configuration is saved. Then other instances of the application, or other users of the EWL library, can be notified when configuration is changed. This will allow us to have EWL update its theme as soon as the configuration is changed, assuming the user used ewl_config to do the changing.

As usual, bug reports to xcomputerman.com/bugs. If you want to discuss, either the enlightenment-devel mailing list or #ewl on irc.freenode.net.