Custom desktop launcher search path in Ubuntu
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
add a comment |
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
add a comment |
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
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
directory-structure desktop application
edited Oct 3 '14 at 22:54
Gilles
531k12810631592
531k12810631592
asked Oct 2 '14 at 20:43
qedqed
1,01141219
1,01141219
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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.
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
add a comment |
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.
add a comment |
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.
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.
answered Jan 6 at 20:16
PatrickPatrick
50.2k11127179
50.2k11127179
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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