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

Specify custom desktop file fields in FyneApp.toml #3958

Merged
merged 7 commits into from
Jun 20, 2023

Conversation

Jacalz
Copy link
Member

@Jacalz Jacalz commented Jun 7, 2023

Description:

This PR adds support for specifying custom metadata fields for Linux and BSD. It is currently hooked up to provide support for adding GenericName, Categories, Comment, and Keywords to the desktop files. These fields are the ones that I had to specify manually in io.github.jacalz.rymdport.desktop for Flatpak packaging to be accepted.

Checklist:

  • Tests included.
  • Lint and formatter run with no errors.
  • Tests all pass.

@Jacalz Jacalz changed the title Advanced desktop file Specify custom desktop file fields in FyneApp.toml Jun 7, 2023
@coveralls
Copy link

coveralls commented Jun 7, 2023

Coverage Status

coverage: 61.861% (-0.05%) from 61.907% when pulling 36e4b7f on Jacalz:advanced-desktop-file into 93998ba on fyne-io:develop.

Copy link
Contributor

@Bluebugs Bluebugs left a comment

Choose a reason for hiding this comment

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

That's a great idea!

cmd/fyne_demo/FyneApp.toml Show resolved Hide resolved
Copy link
Member

@andydotxyz andydotxyz left a comment

Choose a reason for hiding this comment

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

Apologies these pending comments did not get sent :(


[LinuxAndBSD]
GenericName = "Fyne Demo"
Categories = "Development;"
Copy link
Member

Choose a reason for hiding this comment

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

Is the trailing ";" optional? It doesn't seem natural to have it here.
Also should we use a more common list separator for Go developers and convert it where required for the output?

?Perhaps even making it a toml list instead of string?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't know if it technically is required but the official documentation uses it.
https://freedesktop.org/wiki/Howto_desktop_files/

Copy link
Member Author

Choose a reason for hiding this comment

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

A TOML list sounds like a great idea :)

Copy link
Member

Choose a reason for hiding this comment

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

I don't know if it technically is required but the official documentation uses it.

https://freedesktop.org/wiki/Howto_desktop_files/

By using FDo formatting you still require folk to understand the spec - which we should avoid if possible just like how naming avoids it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Indeed but I've switched to TOML lists now so it should no longer be an issue.


[Development]
HelperText = "This binary was build with debug symbol"

[Release]
HelperText = "This binary was build without debug symbol"

[LinuxAndBSD]
Copy link
Member

Choose a reason for hiding this comment

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

If we make it "Linux,BSD" or "Linux&BSD" it will be machine parsable if we decide to match go's approach to this logic :).

Copy link
Member Author

Choose a reason for hiding this comment

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

I tried that but it does not seem to be supported. I tried +, ,, and & before opening this PR but neither seem to be supported.

@Jacalz Jacalz requested a review from andydotxyz June 17, 2023 10:55
Jacalz added a commit to Jacalz/rymdport that referenced this pull request Jun 17, 2023
Bluebugs
Bluebugs previously approved these changes Jun 18, 2023
Comment = "A demo of Fyne and its capabilities."
Keywords = "demo;fyne;"
Keywords = ["demo", "fyne"]
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice

HelperText = "This binary was built without debug symbols"

[LinuxAndBSD]
GenericName = "Fyne Demo"
Copy link
Member

Choose a reason for hiding this comment

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

What is generic name, and how often should it differ from the Name specified in the details section above?

Copy link
Member Author

Choose a reason for hiding this comment

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

For Rymdport, I have "File Transfer" as GenericName. Just like Firefox has "Web Browser". I hope that helps.

Copy link
Member

Choose a reason for hiding this comment

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

Ah yea thanks. I guess maybe it should be "demo app" or "developer tools" so it's clearer why they are different in this example?

Copy link
Member Author

Choose a reason for hiding this comment

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

That's a good point. I'll get that fixed

Copy link
Member Author

Choose a reason for hiding this comment

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

Perhaps "Toolkit Demo" even?

Copy link
Member

Choose a reason for hiding this comment

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

Sounds good

Copy link
Member

@andydotxyz andydotxyz left a comment

Choose a reason for hiding this comment

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

Great addition thanks

@Jacalz
Copy link
Member Author

Jacalz commented Jun 20, 2023

Thanks. This is going to make the release binaries in Geoffrey so much nicer for Rymdport's users :)

@Jacalz Jacalz merged commit 07e3214 into fyne-io:develop Jun 20, 2023
@Jacalz Jacalz deleted the advanced-desktop-file branch June 20, 2023 19:13
Jacalz added a commit to Jacalz/rymdport that referenced this pull request Sep 2, 2023
@p4k1tz
Copy link

p4k1tz commented Jun 30, 2024

The documentation for custom metadata fields needs to be added to https://docs.fyne.io/started/metadata.html

@Jacalz
Copy link
Member Author

Jacalz commented Jun 30, 2024

The documentation for custom metadata fields needs to be added to https://docs.fyne.io/started/metadata.html

Please open an issue for that instead of commenting on a PR that was merged a year ago.

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.

5 participants