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

feat(debian): auto-add an Exec arg (field code) in the .desktop file #256

Merged
merged 4 commits into from
Jul 2, 2024

Conversation

kevinaboos
Copy link
Contributor

@kevinaboos kevinaboos commented Jun 29, 2024

This change adds an {exec_arg} field to the default main.desktop template. This field is populated by handlebars with a sane default value, which is based on whether deep_link_protocols or file_associations in the Config struct have been specified.

This allows an installed Debian package to be invoked by other applications with URLs or files as arguments, as expected.

The main.desktop template previously did not automatically include an Exec field code even if deep_link_protocols or file_associations were set, which could potentially confuse new users who incorrectly expected that the Debian package would automatically handle links and file associations upon installation. This change now ensures their expectations are met.

This change adds an `{exec_arg}` field to the default `main.desktop` template.
This field is populated by handlebars with a sane default value,
which is based on whether `deep_link_protocols` or `file_associations`
in the `Config` struct have been specified.

This allows an installed Debian package to be invoked by other applications
with URLs or files as arguments, as expected.

The `main.desktop` template previously did not automatically include
an Exec field code even if `deep_link_protocols` or `file_associations`
were set, which would confuse new users who incorrectly expected that
the Debian package would automatically handle links and file associations
upon installation. This change now ensures their expectations are met.
crates/packager/src/config/mod.rs Outdated Show resolved Hide resolved
Comment on lines 208 to 211
/// * "%U", if at least one [Config::deep_link_protocols] was specified.
/// * This means that your application can accommodate being invoked with multiple URLs.
/// * "%F", if at least one [Config::file_associations] was specified but no deep link protocols were given, or
/// * This means that your application can accommodate being invoked with multiple file paths.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would switch the order of these, i.e explain %F first and then %U and should also mention that %U will make file paths into file urls

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@kevinaboos
Copy link
Contributor Author

kevinaboos commented Jul 2, 2024

oh, huh, I just noticed that when making changes on my mac, the schema.json files were auto-updated, which didn't happen on my linux box (where I originally made this PR).

Should those schema files be committed, or are they auto-generated by some CI procedure?

Edit: saw your other answer; this should be good to go.

@amr-crabnebula
Copy link
Collaborator

Thanks for your contributions

@amr-crabnebula amr-crabnebula merged commit de4dcca into crabnebula-dev:main Jul 2, 2024
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants