Forum > IDE/CodeTools

(Re)Create .desktop file using Project Options?

(1/4) > >>

dsiders:
The idea is to add a frame to Project Options which enables creation (or recreation) of the .desktop file on supported platforms when the project is built. The major Linux DEs (Gnome and KDE) seem to be reliant on them. Not sure what macOS or other platforms require.

The frame / page could contain edit controls for the required and optional name/value pairs in the Desktop Entry Specification (https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html). It could write the .desktop file to the same directory as the executable when the project is built. Obviously the IDE and LazBuild (and make files?) would need to support the new feature.

I convinced myself that this was a good idea. But I am relatively new to the Linux environment, I realize it is just an INI-style file... but it would be convenient to automate it. Is there an existing tool or mechanism to do this already? I could not find one...

MarkMLl:
I agree that it would be a useful thing to have, provision of .desktop file editors is... erratic.

I suggest familiarising yourself with the various related programs:


--- Code: Text  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---$ apropos xdg exmendis (1)         - enable or disable extra menus for GNOME, KDE and other XDG menu-spec compliant desktopsexmenen (1)          - enable or disable extra menus for GNOME, KDE and other XDG menu-spec compliant desktopssystemd-xdg-autostart-generator (8) - User unit generator for XDG autostart filesuser-dirs.conf (5)   - configuration for xdg-user-dirs-updateuser-dirs.defaults (5) - default settings for XDG user dirsuser-dirs.dirs (5)   - settings for XDG user dirsxdg-dbus-proxy (1)   - D-Bus proxyxdg-desktop-icon (1) - command line tool for (un)installing icons to the desktopxdg-desktop-menu (1) - command line tool for (un)installing desktop menu itemsxdg-email (1)        - command line tool for sending mail using the user's preferred e-mail composerxdg-icon-resource (1) - command line tool for (un)installing icon resourcesxdg-mime (1)         - command line tool for querying information about file type handling and adding descriptions for new file typesxdg-open (1)         - opens a file or URL in the user's preferred applicationxdg-screensaver (1)  - command line tool for controlling the screensaverxdg-settings (1)     - get various settings from the desktop environmentxdg-user-dir (1)     - Find an XDG user dirxdg-user-dirs-update (1) - Update XDG user dir configuration 
MarkMLl

dsiders:

--- Quote from: MarkMLl on June 23, 2024, 08:37:51 pm ---I agree that it would be a useful thing to have, provision of .desktop file editors is... erratic.

--- End quote ---

I was only considering creation... not deployment. Like the path for the executable, that's hard to automate for the various Linuxes .


--- Quote from: MarkMLl on June 23, 2024, 08:37:51 pm ---I suggest familiarising yourself with the various related programs:

--- Code: Text  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---$ apropos xdg(elided) 
--- End quote ---

XDG seems to be a lot like Wayland.... very good at creating specifications that they don't have to implement. :)

Useful links, I'll add those to my retirement reading list.


MarkMLl:

--- Quote from: dsiders on June 23, 2024, 09:17:36 pm ---XDG seems to be a lot like Wayland.... very good at creating specifications that they don't have to implement. :)

--- End quote ---

No, that stuff's important.

What they've done is said "Right, this is the functionality that a desktop will probably need. Format the command lines like this..." and various distreaux have, by and large, complied with their own implementation. However it's my experience that some of the lesser desktops like LXDE (hence the RPi) quite simply don't have a .desktop editor that a developer can invoke to create the file in the first place.

Where does Windows (and for that matter the Mac) stand on this? Is there a concrete file format that can be used to create a shortcut etc.?

MarkMLl

bobby100:

--- Quote from: MarkMLl on June 23, 2024, 10:02:25 pm ---Where does Windows (and for that matter the Mac) stand on this? Is there a concrete file format that can be used to create a shortcut etc.?
--- End quote ---
On Windows, the .lnk files are binary files, but one can use Shell API to create or read .lnk files.

Navigation

[0] Message Index

[#] Next page

Go to full version