Create Desktop launcher for Application (original) (raw)

January 29, 2025, 7:24pm 1

I want make application visible in global menu after build (or installation with cargo in my case)

Can I create .desktop file in valid system location using Glib API? Or this feature should be implemented manually on first application launch, by creating .desktop file in local/share. Just not sure about cache reset etc

bragefuglseth (Brage Fuglseth) January 29, 2025, 7:57pm 2

Sounds like you’re looking for more system integration than what can reasonably be achieved with Cargo alone. While technically possible, it sounds extremely inconvenient and error-prone to manually intervene with desktop files directly in your application code :smile:

Here’s a template that provides all you need by “wrapping” Cargo inside a build performed with Meson. It also adds Flatpak support, should you ever want to distribute your app that way. Meson+Cargo+Flatpak is how practically all GNOME Rust apps are built and distributed.

system (system) Closed February 28, 2025, 7:57pm 3

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.