Skip to content

Add sfdo_desktop_entry_get_exec_arg0() (returns first arg of Exec key)

John Lindgren requested to merge jlindgren90/libsfdo:exec-arg0 into main

Sometimes it's useful to access just the first argument of the Exec key of a desktop file, and sfdo_desktop_entry_get_exec() with all its command formatting capabilities is overkill.

Use case: some X11 applications set WM_CLASS to the name of their executable, which is different from the name of their .desktop file (example: "gimp-2.10" vs. gimp.desktop). I want labwc to be able to match such applications to their .desktop files in order to do icon lookups. I can do this by matching on the Exec key, but since it's necessary to scan through a bunch of desktop entries, I would like to avoid sfdo_desktop_entry_get_exec() and the memory allocations that it performs.

Merge request reports

Loading