-
Notifications
You must be signed in to change notification settings - Fork 28.6k
Create desktop file entry for linux app, fixes #53229 #60534
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
Conversation
@robert-ancell one thing I wasn't sure about in this PR was where to install the files to, as we aren't creating something that can be installed via a typical install target but rather bundling. I just went with bundling the icon and desktop file relative to the data dir in the bundle. A packager should be able to handle relocating those as needed. |
@@ -79,6 +79,11 @@ if(PLUGIN_BUNDLED_LIBRARIES) | |||
COMPONENT Runtime) | |||
endif() | |||
|
|||
install(FILES app.desktop DESTINATION "${INSTALL_BUNDLE_DATA_DIR}/applications" RENAME "{{projectName}}.desktop" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might make sense to use {{linuxIdentifier}}
once #60053 is landed.
Makes sense to me. You could event drop the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is icon.png just an exact copy of an icon that's already in another template? (I'm assuming yes since there's not a CI failure, but I want to be sure since we're no longer adding new icons here.)
@@ -79,6 +79,11 @@ if(PLUGIN_BUNDLED_LIBRARIES) | |||
COMPONENT Runtime) | |||
endif() | |||
|
|||
install(FILES app.desktop DESTINATION "${INSTALL_BUNDLE_DATA_DIR}/applications" RENAME "{{projectName}}.desktop" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this go to ~/Desktop, so that the app launches with an icon when run during development?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, the user level .desktop
files are stored at ~/.local/share/applications
. I think ${INSTALL_BUNDLE_DATA_DIR}
points to ~/.local/share
probably. Whereas the root level .desktop
files are stored at /usr/share/applications
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
${INSTALL_BUNDLE_DATA_DIR} points to ~/.local/share probably.
It doesn't; see the rest of the install section of this CMake file if you are interested in the details.
[Desktop Entry] | ||
Name={{projectName}} | ||
Comment={{description}} | ||
Icon=icon.png |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's renamed in the install step, so this won't be right. Also, doesn't this need to be the full path to the icon, added by a script during the install step?
Name={{projectName}} | ||
Comment={{description}} | ||
Icon=icon.png | ||
Exec={{projectName}} %U |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be the binary name, set from the install script, so it updates correctly if someone renames the binary.
Terminal=false | ||
Type=Application | ||
Categories=Other; | ||
Keywords=Other; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe put a comment on these two lines explaining what they are and where to get more information, since we expect people to change them presumably. We should assume most people won't be familiar with these files and provide help and/or links to instructions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR triage: What is the status of this PR? Is it ready to land? |
It's waiting for responses to/updates for my comments |
@kenvandine We decided to close this and just do the set-icon part, right? |
Hi, thanks for taking interest in #53229!
Was the label waiting for customer response meant for me? |
Yes, I'm closing this. Thanks! |
What is meant by the "set-icon" part? Is that already taken care of? Thx for the info :D |
See #53229 (comment) |
Description
This adds a generic app.desktop file as well as an icon.png to the linux template. These are necessary to create application launchers.
Related Issues
This fixes #53229
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]
). This will ensure a smooth and quick review process.///
).flutter analyze --flutter-repo
) does not report any problems on my PR.Breaking Change
Did any tests fail when you ran them? Please read Handling breaking changes.