Problem:

I have made .desktop files for Ubuntu 16.04 to access my Google Chrome profiles, but once I upgraded to Ubuntu 17.10 (it worked on Ubuntu 17.04) they got removed and I can't pin them back.

Sample File

#!/usr/bin/env xdg-open

[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Icon[en_US]=google-chrome
Name[en_US]=Google Chrome
Exec=google-chrome --profile-directory=Default
Comment[en_US]=Chrome
Name=Google Chrome
Comment=Chrome Browser
Icon=google-chrome
Categories=Browser;Internet;
  • 1
    If you can see them in the gnome-shell overview then you can DnD to the dock (just not at the end). If not then mark the .desktop as executable, d. click on, set as trusted. Once running it should show in dock & you can pin – doug Oct 22 '17 at 1:00
  • @doug But wouldn't that kill the Exec=google-chrome --profile-directory=Default? – Teivel Oct 22 '17 at 1:14
  • I don't know what you mean. Do you know what I mean by "mark as executable" i.e, r. click on the .desktop .> properties > Permissions > obvious – doug Oct 22 '17 at 1:32
  • @doug it passes arguments to the program before launching, in this case, the profile, if I was to pin it, only the application would launch, not the right profile (ie. guest, personal, etc) – Teivel Oct 22 '17 at 1:54
up vote 40 down vote accepted
  1. Create a .desktop file in ~/.local/share/applications.
  2. Add the following lines in it

    [Desktop Entry]
    Comment=Chrome my profile
    Terminal=false
    Name=My Chrome
    Exec=google-chrome --profile-directory=Default
    Type=Application
    Icon=google-chrome
    

    (I'm naming it "My Chrome" to avoid confusion with the already existing Google Chrome launcher. You can use any other name.)

  3. Make it executable.

  4. Click on Activities or Show Applications and search for "My Chrome". It should appear.

  5. Right click on it and mark as favourite.

    When right clicking on application icon in dock doesn't show "Add to favourites" option, search for the application in Activities screen, and then drag it across to the dock (suggested by Legolas).

If nothing works, see this Q&A: Cannot add custom launcher to Dock (*Add to Favorites*)

  • Is a restart or re-login needed? For me this does not even make the thing show up in the "Activities" dashboard. – Zelphir Jan 16 at 10:29
  • @Zelphir Should not be required, but try anyway. If still doesn't work, see this. – pomsky Jan 16 at 10:35
  • When you put in a path, you can't use ~. Use the full path. When I had ~, nothing showed up. Moving to a full path worked fine. – Virmundi May 28 at 17:47
  • Yes, of course, you can't put ~ in the .desktop file, you'll have to put the full path (there is no ~ in the content of the sample .desktop file though). – pomsky May 28 at 18:01
  • Thanks a lot! After 2 hours of browsing, this answer solved my problem! – Mehmet Çağrı ARI Jun 12 at 11:32

I had the same problem with Firefox Nightly. The following configuration works for me in ~/.local/share/applications/firefox-nightly.desktop:

[Desktop Entry]
Type=Application
Name=Firefox Nightly
#
# WARNING: Remember to fix the path in Icon and Exec
#
Icon=/path/to/firefox-nightly/browser/icons/mozicon128.png
Exec=/path/to/firefox-nightly/firefox %u
Terminal=false
StartupWMClass=Nightly

Without StartupWMClass, the running application is not recognized and the icon is displayed twice on the dock.

  • 2
    Multiple icons of the same application (and also fallback to a default "blank" icon after failing to show specified icon in the .desktop file) sounds like a separate issue. I think it would be better if you ask a new question and add an answer yourself. There's already this one. – pomsky Nov 7 '17 at 15:37
  • 1
    @pomsky I posted it here because I had the same problem: it was not possible to mark the app as favourite in the context menu. Dragging it from the activities screen did almost work: the icon was pinned but, clicking it, another icon was shown. By adding StartupWMClass to your config, it finally worked. Sorry for the confusion. Maybe I should answer to this one? – Marcello Nuccio Nov 7 '17 at 17:29
  • 1
    Already I have posted an answer (StartupWMClass trick) there a week ago. If your answer is significantly different you're most welcome to post a new answer. But the thing that question is a bit misleading, there OP has the issue in only Wayland, not Xorg. So I think it's better if you could post an new question and answer it yourself. I didn't see a new questions with multiple icons issue recently, only saw a comment. – pomsky Nov 7 '17 at 17:34

For anyone if the application is not appearing in Activities, make sure you dote have "NoDisplay=true" in the .desktop file for your application.

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.