89luca89 / distrobox

Use any linux distribution inside your terminal. Enable both backward and forward compatibility with software and freedom to use whatever distribution you’re more comfortable with. Mirror available at: https://gitlab.com/89luca89/distrobox
https://distrobox.it/
GNU General Public License v3.0
10.15k stars 419 forks source link

[Discussion] Matching of desktop files in distrobox-export #1568

Open TigerGorilla2 opened 1 month ago

TigerGorilla2 commented 1 month ago

https://github.com/89luca89/distrobox/blob/c05b6a43769bfa56d572a457f1420e0e2589fe3b/distrobox-export#L456

When exporting the matching is pretty loose (surrounded by grabby .* regex) and when exporting something with a short name (1-3 characters) it can match a lot of things. Or in the case nothing is supplied it matches everything! (There should probably be a check whether exported_app is empty.)

I don't know what a good approach to the matching problem would be, since it's nice for users to be able to export something by a name guess that's only close enough. Maybe a confirmation dialog if it matches multiple desktop files?

I think it might be a good idea to have a flag to enable/disable searching of the Name= field. Then when exporting by the command name you could use Exec=${exported_app} (notice the space at the end) to only match the provided command name. Since I'd assume someone using the command name would provide the full one. PS the .* is not needed at the end.