Custom desktop launcher search path in Ubuntu

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












6















I know I can write a .desktop file in /usr/share/applications or ~/.local/share/applications, but can I add new folders to the search path similar to the $PATH environment variable?



For example, I want to put my .desktop files in ~/mydesktop/ and make them available to the open-with dialog in Dolphin or Nautilus.










share|improve this question




























    6















    I know I can write a .desktop file in /usr/share/applications or ~/.local/share/applications, but can I add new folders to the search path similar to the $PATH environment variable?



    For example, I want to put my .desktop files in ~/mydesktop/ and make them available to the open-with dialog in Dolphin or Nautilus.










    share|improve this question


























      6












      6








      6








      I know I can write a .desktop file in /usr/share/applications or ~/.local/share/applications, but can I add new folders to the search path similar to the $PATH environment variable?



      For example, I want to put my .desktop files in ~/mydesktop/ and make them available to the open-with dialog in Dolphin or Nautilus.










      share|improve this question
















      I know I can write a .desktop file in /usr/share/applications or ~/.local/share/applications, but can I add new folders to the search path similar to the $PATH environment variable?



      For example, I want to put my .desktop files in ~/mydesktop/ and make them available to the open-with dialog in Dolphin or Nautilus.







      directory-structure desktop application






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Oct 3 '14 at 22:54









      Gilles

      532k12810661594




      532k12810661594










      asked Oct 2 '14 at 20:43









      qedqed

      1,02141220




      1,02141220




















          1 Answer
          1






          active

          oldest

          votes


















          0














          You need to create a directory called applications, put your .desktop files in there, and then add the path of the parent directory of applications (not including the applications directory itself!) to the XDG_DATA_DIRS environment variable. Once you do that, your files will be picked up.



          It is important to note that the path needs to be added to this variable before your desktop manager is started. How this is accomplished will vary by distro and/or login manager. See also this answer on the subject.



          The documentation for on the XDG_DATA_DIRS variable can be found here: https://standards.freedesktop.org/menu-spec/latest/ar01s02.html




          $XDG_DATA_DIRS/applications/

          This directory contains a .desktop file for each possible menu item. Each directory in the $XDG_DATA_DIRS search path should be used (i.e. desktop entries are collected from all of them, not just the first one that exists). When two desktop entries have the same name, the one appearing earlier in the path is used.



          The element in a menu file indicates that this default list of desktop entry locations should be scanned at that point. If a menu file does not contain , then these locations are not scanned.







          share|improve this answer






















            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "106"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f158946%2fcustom-desktop-launcher-search-path-in-ubuntu%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            You need to create a directory called applications, put your .desktop files in there, and then add the path of the parent directory of applications (not including the applications directory itself!) to the XDG_DATA_DIRS environment variable. Once you do that, your files will be picked up.



            It is important to note that the path needs to be added to this variable before your desktop manager is started. How this is accomplished will vary by distro and/or login manager. See also this answer on the subject.



            The documentation for on the XDG_DATA_DIRS variable can be found here: https://standards.freedesktop.org/menu-spec/latest/ar01s02.html




            $XDG_DATA_DIRS/applications/

            This directory contains a .desktop file for each possible menu item. Each directory in the $XDG_DATA_DIRS search path should be used (i.e. desktop entries are collected from all of them, not just the first one that exists). When two desktop entries have the same name, the one appearing earlier in the path is used.



            The element in a menu file indicates that this default list of desktop entry locations should be scanned at that point. If a menu file does not contain , then these locations are not scanned.







            share|improve this answer



























              0














              You need to create a directory called applications, put your .desktop files in there, and then add the path of the parent directory of applications (not including the applications directory itself!) to the XDG_DATA_DIRS environment variable. Once you do that, your files will be picked up.



              It is important to note that the path needs to be added to this variable before your desktop manager is started. How this is accomplished will vary by distro and/or login manager. See also this answer on the subject.



              The documentation for on the XDG_DATA_DIRS variable can be found here: https://standards.freedesktop.org/menu-spec/latest/ar01s02.html




              $XDG_DATA_DIRS/applications/

              This directory contains a .desktop file for each possible menu item. Each directory in the $XDG_DATA_DIRS search path should be used (i.e. desktop entries are collected from all of them, not just the first one that exists). When two desktop entries have the same name, the one appearing earlier in the path is used.



              The element in a menu file indicates that this default list of desktop entry locations should be scanned at that point. If a menu file does not contain , then these locations are not scanned.







              share|improve this answer

























                0












                0








                0







                You need to create a directory called applications, put your .desktop files in there, and then add the path of the parent directory of applications (not including the applications directory itself!) to the XDG_DATA_DIRS environment variable. Once you do that, your files will be picked up.



                It is important to note that the path needs to be added to this variable before your desktop manager is started. How this is accomplished will vary by distro and/or login manager. See also this answer on the subject.



                The documentation for on the XDG_DATA_DIRS variable can be found here: https://standards.freedesktop.org/menu-spec/latest/ar01s02.html




                $XDG_DATA_DIRS/applications/

                This directory contains a .desktop file for each possible menu item. Each directory in the $XDG_DATA_DIRS search path should be used (i.e. desktop entries are collected from all of them, not just the first one that exists). When two desktop entries have the same name, the one appearing earlier in the path is used.



                The element in a menu file indicates that this default list of desktop entry locations should be scanned at that point. If a menu file does not contain , then these locations are not scanned.







                share|improve this answer













                You need to create a directory called applications, put your .desktop files in there, and then add the path of the parent directory of applications (not including the applications directory itself!) to the XDG_DATA_DIRS environment variable. Once you do that, your files will be picked up.



                It is important to note that the path needs to be added to this variable before your desktop manager is started. How this is accomplished will vary by distro and/or login manager. See also this answer on the subject.



                The documentation for on the XDG_DATA_DIRS variable can be found here: https://standards.freedesktop.org/menu-spec/latest/ar01s02.html




                $XDG_DATA_DIRS/applications/

                This directory contains a .desktop file for each possible menu item. Each directory in the $XDG_DATA_DIRS search path should be used (i.e. desktop entries are collected from all of them, not just the first one that exists). When two desktop entries have the same name, the one appearing earlier in the path is used.



                The element in a menu file indicates that this default list of desktop entry locations should be scanned at that point. If a menu file does not contain , then these locations are not scanned.








                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jan 6 at 20:16









                PatrickPatrick

                50.2k11127179




                50.2k11127179



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Unix & Linux Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f158946%2fcustom-desktop-launcher-search-path-in-ubuntu%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown






                    Popular posts from this blog

                    How to check contact read email or not when send email to Individual?

                    Bahrain

                    Postfix configuration issue with fips on centos 7; mailgun relay