prepend to XDG_DATA_DIRs so we get apps in e's prefix. :)

SVN revision: 73036
This commit is contained in:
Carsten Haitzler 2012-06-29 13:00:30 +00:00
parent b5f4a75990
commit 6387c80851
1 changed files with 24 additions and 0 deletions

View File

@ -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");