Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
TigerGorilla2 opened this issue Sep 25, 2024 · 0 comments
Open

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

TigerGorilla2 opened this issue Sep 25, 2024 · 0 comments
Labels
question Further information is requested

Comments

@TigerGorilla2
Copy link
Contributor

xargs -I{} grep -l -e "Exec=.*${exported_app}.*" -e "Name=.*${exported_app}.*" "{}" | sed 's/./\\&/g' |

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.

@TigerGorilla2 TigerGorilla2 added the question Further information is requested label Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant