From 6387c8085134b5d20841ab03b649148d3fdc7df7 Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Fri, 29 Jun 2012 13:00:30 +0000 Subject: [PATCH] prepend to XDG_DATA_DIRs so we get apps in e's prefix. :) SVN revision: 73036 --- src/bin/e_main.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/bin/e_main.c b/src/bin/e_main.c index 2c80f5a54..cad04d686 100644 --- a/src/bin/e_main.c +++ b/src/bin/e_main.c @@ -115,6 +115,28 @@ EAPI Eina_Bool starting = EINA_TRUE; EAPI Eina_Bool stopping = EINA_FALSE; EAPI Eina_Bool restart = EINA_FALSE; +static void +_xdg_data_dirs_augment(void) +{ + const char *s = getenv("XDG_DATA_DIRS"); + const char *p = e_prefix_get(); + char newpath[PATH_MAX], buf[PATH_MAX]; + + if (!p) return; + + snprintf(newpath, sizeof(newpath), "%s:%s/share", e_prefix_data_get(), p); + if (s) + { + if (strncmp(s, newpath, strlen(newpath))) + { + snprintf(buf, sizeof(buf), "%s:%s", newpath, s); + e_util_env_set("XDG_DATA_DIRS", buf); + } + } + else + e_util_env_set("XDG_DATA_DIRS", newpath); +} + static void _fix_user_default_edj(void) { @@ -444,6 +466,8 @@ main(int argc, char **argv) TS("E_Config Init Done"); _e_main_shutdown_push(e_config_shutdown); + _xdg_data_dirs_augment(); + _fix_user_default_edj(); TS("E_Randr Init");