How can i make my .desktop app global?

algorithms

I have a .desktop app that runs a shell script, this shell script runs a python code when the app is double-clicked, and i want to be able to launch it from all the directories on my laptop and to keep the icon stable even if the directories of the image or icon or app was changed!

How can i make my app global?

vanadium

As apparent from the answer of Zany_Zachary suggested, launchers in /usr/share/applications are available for all users. Launchers under ~/.local/share/applications are available for the current user only. When the launcher is in these places, it will be picked up by your desktop menu or launcher. The location /usr/share/applications is a directory in use by the software management system APT of the operating system, so, although it would work, you should not place your custom .desktop files there. Instead, use the folder /usr/local/share/applications. That folder does not exist by default on Ubuntu, so you may need to create it first.

This is how "global" from your title is most readily understood. However, in your question, you suggest that under "global" you understand also something as "portable", i.e., it should continue to work even if the icon or app changed location. Still, you have to obey the conventions of the operating system where to place your icon or executable. So there is no such thing as a "global" .desktop launcher that keeps working irrespective of where you place icon or executable.

There are limits in this "portability". For one thing, the name of the icon or from the executable cannot change, because the name is hardcoded in the .desktop file. However, you can omit the path from the .desktop file, but then, you have to place icon and executable in specific places searched by the operating system.

The icon

The icon is defined in the .desktop file on the Icon= line.

If you only provide the name of the icon (without the extension), the operating system will search ~/.icons and ~/.local/share/icons first, and then search the system wide icon directories mostly under /usr/share/icons and /usr/local/share/icons. A graphics file with .png or .svg extension in one of these folders will be picked up by the menuing system. If no corresponding graphic file is found, the system will revert to a default fallback icon.

The application

The executable is defined in the .desktop file on the Exec= line.

Also here, the system will search predefined paths for an executable a the matching name if no full file path is provided. You can see the folders and their order in which they are searched with the echo $PATH command.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How can I make my own custom desktop widgets?

From Dev

How can I make a desktop wallpaper slideshow with my own images?

From Dev

Is there an App that can make my desktop dimmer

From Dev

How can I make a list of all dataframes that are in my global environment?

From Dev

QT - How can I make this array global for my GUI?

From Dev

In my Ember.js app, how can I define a global config value that can be referenced in my templates?

From Dev

How can I make my app appear in UIActivityViewController for text?

From Dev

How can I make my android app work online?

From Dev

How can i make my app appear on tablets

From Dev

How can I create launchers on my desktop?

From Dev

How can I make my header position correctly across mobile and desktop devices?

From Dev

How can I keep my app and desktop settings between VDI logins with VMware Horizon?

From Dev

How can I programatically show/hide my app window with global shortcut key?

From Dev

How can I programatically show/hide my app window with global shortcut key?

From Dev

How can I make my command more susceptible to system slowdowns so as to use it as a visual QoS widget on my desktop?

From Dev

How can I stream my laptop's desktop to my iPad?

From Dev

How can I make my navbar appear on every page in my rails app?

From Dev

how can i condense my XML and Java code to make my app run smoother

From Dev

how can i condense my XML and Java code to make my app run smoother

From Dev

My app shows a splash screen. How can I make my test wait for the main screen?

From Dev

iOS Enterprise app - How can I make sure my app runs in the background?

From Dev

How do I make my Ubuntu Desktop PC a server?

From Dev

How can i make a npm package that can be installed in global

From Dev

How can I find repos of my GitHub account repos from GitHub Desktop, once a local repo takes all the place in the app?

From Dev

How I can make Row Grouping in DataGrid WPF Desktop Application

From Dev

How can I Make Single Application for web and desktop in JAVA

From Dev

How can I make my navbar responsive?

From Dev

How can I make my program faster?

From Dev

How I can make my constructor synchronized?

Related Related

  1. 1

    How can I make my own custom desktop widgets?

  2. 2

    How can I make a desktop wallpaper slideshow with my own images?

  3. 3

    Is there an App that can make my desktop dimmer

  4. 4

    How can I make a list of all dataframes that are in my global environment?

  5. 5

    QT - How can I make this array global for my GUI?

  6. 6

    In my Ember.js app, how can I define a global config value that can be referenced in my templates?

  7. 7

    How can I make my app appear in UIActivityViewController for text?

  8. 8

    How can I make my android app work online?

  9. 9

    How can i make my app appear on tablets

  10. 10

    How can I create launchers on my desktop?

  11. 11

    How can I make my header position correctly across mobile and desktop devices?

  12. 12

    How can I keep my app and desktop settings between VDI logins with VMware Horizon?

  13. 13

    How can I programatically show/hide my app window with global shortcut key?

  14. 14

    How can I programatically show/hide my app window with global shortcut key?

  15. 15

    How can I make my command more susceptible to system slowdowns so as to use it as a visual QoS widget on my desktop?

  16. 16

    How can I stream my laptop's desktop to my iPad?

  17. 17

    How can I make my navbar appear on every page in my rails app?

  18. 18

    how can i condense my XML and Java code to make my app run smoother

  19. 19

    how can i condense my XML and Java code to make my app run smoother

  20. 20

    My app shows a splash screen. How can I make my test wait for the main screen?

  21. 21

    iOS Enterprise app - How can I make sure my app runs in the background?

  22. 22

    How do I make my Ubuntu Desktop PC a server?

  23. 23

    How can i make a npm package that can be installed in global

  24. 24

    How can I find repos of my GitHub account repos from GitHub Desktop, once a local repo takes all the place in the app?

  25. 25

    How I can make Row Grouping in DataGrid WPF Desktop Application

  26. 26

    How can I Make Single Application for web and desktop in JAVA

  27. 27

    How can I make my navbar responsive?

  28. 28

    How can I make my program faster?

  29. 29

    How I can make my constructor synchronized?

HotTag

Archive