biome: 1.9.2 -> 1.9.3
[NixPkgs.git] / pkgs / applications / misc / fehlstart / use-nix-profiles.patch
blob0c06e53f98148f56b4242231b98f7f3824ee789d
1 --- fehlstart-9f4342d75ec5e2a46c13c99c34894bc275798441-src/fehlstart.c 1970-01-01 01:00:01.000000000 +0100
2 +++ fehlstart.c 2016-08-10 12:21:11.231638418 +0200
3 @@ -779,8 +779,15 @@
4 read_settings(setting_file, &settings);
5 update_commands();
6 g_hash_table_foreach(action_map, update_launcher, NULL);
7 - add_launchers(STR_S(APPLICATIONS_DIR_0));
8 - add_launchers(STR_S(APPLICATIONS_DIR_1));
9 - add_launchers(STR_S(USER_APPLICATIONS_DIR));
10 + const char* nixprofiles = getenv("NIX_PROFILES");
11 + if(nixprofiles != NULL) {
12 + const char* pch = strtok(nixprofiles, " ");
13 + while (pch != NULL)
14 + {
15 + String nix_dir = str_concat((String) { pch, strlen(pch), false },STR_S("/share/applications"));
16 + add_launchers(nix_dir);
17 + pch = strtok(NULL, " ");
18 + }
19 + }
20 return NULL;