Export apps to the menu by desktop-file id, not display name - #220
Open
kacperpaczos wants to merge 1 commit into
Open
Export apps to the menu by desktop-file id, not display name#220kacperpaczos wants to merge 1 commit into
kacperpaczos wants to merge 1 commit into
Conversation
Add To Menu passed the application's display name to distrobox-export --app.
--app matches against the desktop file, so a display name that is blank,
shared between apps, or matches several files could export the wrong app or
more than one. The host side is detected and removed by desktop-file id
({box}-{id}.desktop), so export was keyed on something else entirely.
Identify the app by its desktop-file id everywhere: build the exact in-box
path (/usr/share/applications/{id}.desktop) and hand that to --app for both
export and delete, so one click exports exactly one app and it lines up with
detection and removal. The path builder is a small pure function with a test.
This was referenced Aug 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add To Menu handed the application's display name to
distrobox-export --app. But--appmatches against the desktop file, and a display name can be blank, shared between apps, or match several files — so one click could export the wrong app, or more than one. Meanwhile the host copy is detected and removed by desktop-file id ({box}-{id}.desktop), so export was keyed on something different from detection and removal.This identifies the app by its desktop-file id in all three places: it builds the exact in-box path (
/usr/share/applications/{id}.desktop) and passes that to--appfor both export and--delete. So a single click exports exactly one app, and export, the "already on the menu" detection, and Remove From Menu all agree on which app they mean.The path builder is a small pure function with a unit test.
Note for the maintainer: this is the reliable-add/remove half of a larger request I had (also wanting a custom, per-app menu label like
App:box, and having that follow a box rename). I left those out on purpose —distrobox-export --export-labelalready tags exports with(on <box>), and distrobox has no in-place container rename to hang label-propagation off, so those parts want a design conversation first rather than shipping half-formed.