Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Closed
wants to merge 1 commit into from

Conversation

kenvandine
Copy link
Contributor

@kenvandine kenvandine commented Jun 29, 2020

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.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I signed the CLA.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Did any tests fail when you ran them? Please read Handling breaking changes.

@fluttergithubbot fluttergithubbot added the tool Affects the "flutter" command-line tool. See also t: labels. label Jun 29, 2020
@kenvandine kenvandine requested a review from robert-ancell June 29, 2020 17:57
@kenvandine
Copy link
Contributor Author

@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"
Copy link
Contributor

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.

@robert-ancell
Copy link
Contributor

@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.

Makes sense to me. You could event drop the applications/ and icons/ dirs, as they seem a bit unnecessary with only one item in them.

Copy link
Contributor

@robert-ancell robert-ancell left a comment

Choose a reason for hiding this comment

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

LGTM.

Copy link
Contributor

@stuartmorgan-g stuartmorgan-g left a 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"
Copy link
Contributor

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?

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.

Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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;
Copy link
Contributor

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.

Copy link
Contributor

@YazeedAlKhalaf YazeedAlKhalaf left a comment

Choose a reason for hiding this comment

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

LGTM

@zanderso
Copy link
Member

zanderso commented Aug 6, 2020

PR triage: What is the status of this PR? Is it ready to land?

@stuartmorgan-g
Copy link
Contributor

PR triage: What is the status of this PR? Is it ready to land?

It's waiting for responses to/updates for my comments

@zanderso zanderso added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Sep 10, 2020
@stuartmorgan-g
Copy link
Contributor

@kenvandine We decided to close this and just do the set-icon part, right?

@yozachar
Copy link

Hi, thanks for taking interest in #53229!

@kenvandine We decided to close this and just do the set-icon part, right?

Was the label waiting for customer response meant for me?

@kenvandine
Copy link
Contributor Author

@kenvandine We decided to close this and just do the set-icon part, right?

Yes, I'm closing this. Thanks!

@kenvandine kenvandine closed this Sep 29, 2020
@Gustl22
Copy link
Contributor

Gustl22 commented Jul 31, 2023

@kenvandine We decided to close this and just do the set-icon part, right?

What is meant by the "set-icon" part? Is that already taken care of? Thx for the info :D

@stuartmorgan-g
Copy link
Contributor

What is meant by the "set-icon" part?

See #53229 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tool Affects the "flutter" command-line tool. See also t: labels. waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Proposal] Icon support Linux desktop application
9 participants