Create desktop menu file on linux
Description
It would be great if the app had an option to create NotepadNext.desktop, so it would be available for the desktop.
This will make distribution from AppImage a reality, as you just need to download the new one, re-create the desktop file - and remove the older AppImage.
Describe the solution you'd like
No response
Describe alternatives you've considered
No response
I'm not a Linux user at all so if something like that makes sense, I'm not opposed to someone implementing it as long as it isn't overly complex or hard to maintain.
Is there any other open source applications that do this? Just curious what it all entails from an end user perspective.
Is there any other open source applications that do this? Just curious what it all entails from an end user perspective.
Hello, dail8859.
Let me explain. The file "NotepadNext.desktop" or "notepadnext.desktop" is necessary for a NotepadNext program menu to be displayed in GNU/Linux distributions. The ".desktop" files are usually stored in the "/usr/share/applications" folder. Without the ".desktop" file, there is no way to display the menu or a shortcut in the toolbar or on the desktop of GNU/Linux distributions.
A Google search for "What is the ".desktop" file for in GNU/Linux distributions?" yielded:
https://www.debian.org/doc/manuals/debian-reference/ch09.html
"9.4.10. Starting a program from GUI For the command-line interface (CLI), the first program with the matching name found in the directories specified in the $PATH environment variable is executed. See Section 1.5.3, “The "$PATH" variable”.
For the graphical user interface (GUI) compliant to the freedesktop.org standards, the .desktop files in the /usr/share/applications/ directory provide necessary attributes for the GUI menu display of each program. Each package which is compliant to Freedesktop.org's xdg menu system installs its menu data provided by ".desktop" under "/usr/share/applications/". Modern desktop environments which are compliant to Freedesktop.org standard use these data to generate their menu using the xdg-utils package. See "/usr/share/doc/xdg-utils/README".
For example, the chromium.desktop file defines attributes for the "Chromium Web Browser" such as "Name" for the program name, "Exec" for the program execution path and arguments, "Icon" for the icon used, etc. (see the Desktop Entry Specification) as follows:"
[Desktop Entry] Version=1.0 Name=Chromium Web Browser GenericName=Web Browser Comment=Access the Internet Comment[fr]=Explorer le Web Exec=/usr/bin/chromium %U Terminal=false X-MultipleArgs=false Type=Application Icon=chromium Categories=Network;WebBrowser; MimeType=text/html;text/xml;application/xhtml_xml;x-scheme-handler/http;x-scheme-handler/https; StartupWMClass=Chromium StartupNotify=true
In the example above, the entries "Name[pt_BR]=Navegador de Internet Chromium" (Chromium Internet Browser) are missing, which allows the menu to be displayed with texts in Brazilian Portuguese. For European Portuguese, the entry "Name[pt]=" is required, as well as for the other languages where it is translated so that the texts in English are not displayed (Chromium Web Browser). The other entries "GenericName[pt_BR]=" and "Comment[pt_BR]=" are missing. Note that in the example above, only the entry "Comment[fr]=" has a translation.
I hope these explanations and the example above are enough to clarify your doubt.
Is there any other open source applications that do this? Just curious what it all entails from an end user perspective.
Olá, dail8859.
Eu explico para você. O arquivo "NotepadNext.desktop" ou "notepadnext.desktop" é necessário para que um menu do programa NotepadNext seja exibido nas distribuições GNU/Linux. Os arquivos ".desktop" costumam ser armazenados na pasta "/usr/share/applications". Sem o arquivo ".desktop" não tem como exibir o menu ou um atalho na barra de ferramentas ou na área de trabalho das distribuições GNU/Linux.
Uma pesquisa no Google por "Para que serve o arquivo ".desktop" nas distribuições GNU/Linux?" obtive:
https://www.debian.org/doc/manuals/debian-reference/ch09.html
"9.4.10. Starting a program from GUI For the command-line interface (CLI), the first program with the matching name found in the directories specified in the $PATH environment variable is executed. See Section 1.5.3, “The "$PATH" variable”.
For the graphical user interface (GUI) compliant to the freedesktop.org standards, the .desktop files in the /usr/share/applications/ directory provide necessary attributes for the GUI menu display of each program. Each package which is compliant to Freedesktop.org's xdg menu system installs its menu data provided by ".desktop" under "/usr/share/applications/". Modern desktop environments which are compliant to Freedesktop.org standard use these data to generate their menu using the xdg-utils package. See "/usr/share/doc/xdg-utils/README".
For example, the chromium.desktop file defines attributes for the "Chromium Web Browser" such as "Name" for the program name, "Exec" for the program execution path and arguments, "Icon" for the icon used, etc. (see the Desktop Entry Specification) as follows:"
[Desktop Entry] Version=1.0 Name=Chromium Web Browser GenericName=Web Browser Comment=Access the Internet Comment[fr]=Explorer le Web Exec=/usr/bin/chromium %U Terminal=false X-MultipleArgs=false Type=Application Icon=chromium Categories=Network;WebBrowser; MimeType=text/html;text/xml;application/xhtml_xml;x-scheme-handler/http;x-scheme-handler/https; StartupWMClass=Chromium StartupNotify=true
No exemplo acima, estão faltando as entradas "Name[pt_BR]=Navegador de Internet Chromium" que permite exibir o menu com os textos em idioma português do Brasil. Para o idioma português Europeu é necessário a entrada "Name[pt]=", bem como dos outros idiomas onde é traduzido para não ser exibido os textos em idioma inglês (Chromium Web Browser). As outras entradas "GenericName[pt_BR]=" e "Comment[pt_BR]=". Observe que no exemplo acima, apenas a entrada "Comment[fr]=" possui uma tradução.
Eu espero que estas explicações e o exemplo acima sejam suficientes para esclarecer a sua dúvida.
Placing the desktop file into the right location is the job of the packaging system or the package manager.
For Appimages there is AppImageLauncher which does exactly this:
AppImage desktop integration This core feature allows you to integrate AppImages you download into your application menu or launcher, to make it easier for you to launch them. It also takes care of moving them into a central location, where you can find them later. Furthermore, it sets up the update and removal entries in the launcher for you.
This is just my personal opinion and not representing the opinion of NotepadNext as a project or its authors
There is a desktop file already here: https://github.com/dail8859/NotepadNext/blob/3e928d91b8fc8bb5c77801ee8652f41e98d12571/deploy/linux/NotepadNext.desktop
I'm just not sure what the actually ask is? Doesn't the AppImage already use it?
The desktop file is used within the app image to display the icon, and make it visible on Wayland
If you are using appimage, you are the distributor. The desktop file should be in ~/.local not /usr/share/.
Does this clarify things?
It would be great if the app had an option to create NotepadNext.desktop, so it would be available for the desktop.
So what is the exact behavior that is missing? Each time the application starts up see if there is a NotepadNext.desktop file in ~/.local?
Or is it something within the AppImage?
The desktop file should be installed i to the local home dir. And point to the exact path of the AppImage so the desktop environment can start the exe.
Hello dail8859.
There is no problem if the same "NotepadNext.desktop" file is stored in the "~/.local" folder or in the "/usr/share/applications" folder. The problem is that there is no "NotepadNext.desktop" for GNU/Linux distributions.
Olá, dail8859.
Não tem problema algum se o mesmo arquivo "NotepadNext.desktop" estiver armazenado na pasta "~/.local" ou na pasta "/usr/share/applications". O problema é não ter o "NotepadNext.desktop" para as distribuições GNU/Linux.
Looks like after #764 this issue can be closed?
you can close it. But you still will not see the Application in the system menus, and not in "open with".
In order to use it - the desktop file needs to be installed in the proper location.