Gnome 3 : How do I create a launcher in the dock?

15,093

Solution 1

Ok so I was able to add it to the dock following these steps. Add this desktop file to ~/.local/share/applications as postman.desktop:

[Desktop Entry]
Type=Application
Name=Postman
Icon=/home/[my user name]/Utilities/Postman/app/resources/app/assets/icon.png
Exec=/home/[my user name]/Utilities/Postman/app/Postman
Terminal=false
Categories=Development;

then searching for "postman" via "Activities" (it only shows up there if you already created the .desktop file) and right click it > add to favorites.

Solution 2

There are two places, where you can place your *.desktop file:

  • /usr/share/applications/
  • ~/.local/share/applications/.

But if there is a *.desktop file of the same name in both locations and one of them has Exec=... pointing to a non-existent target, then you will not be able see any of the launchers in Applications.

Share:
15,093

Related videos on Youtube

Tom
Author by

Tom

My about me is currently blank

Updated on September 18, 2022

Comments

  • Tom
    Tom over 1 year

    First of all, I saw this question and all the others with similar answer and it does not seem to work for me. I use Ubuntu 19.04 and GNOME 3.32.1

    I downloaded Postman (a code testing tool) and I want to be able to launch it from the dock. When I launch it from the shortcut, it appears in the dock:

    enter image description here

    But when I right-click it, I cannot add it to my favorites, which usually allows me to pin an application to the dock: enter image description here

    I also tried to add a desktop file to /usr/share/applications and ~/.local/share/applications and make it executable, and then restarting gnome, but it did nothing. Desktop file :

    [Desktop Entry]
    Type=Application
    Encoding=UTF-8
    Name=Postman
    Icon=/home/[my user name]/Utilities/Postman/app/resources/assets/icon.png
    Exec=/home/[my user name]/Utilities/Postman/app/Postman
    Terminal=false
    Categories=Development;
    
    • pLumo
      pLumo over 4 years
      You won't make a .Desktop file executable. Did you try little tool called alacarte to create a launcher ?
    • Tom
      Tom over 4 years
      I forgot to mention that but yes I did, did not work either. Also I was able to give executable rights to a .desktop file.
    • Enrique René
      Enrique René over 3 years
      example in GNOME documentation - developer.gnome.org/integration-guide/stable/…
  • Communicative Algebra
    Communicative Algebra almost 4 years
    This does not work for me on Ubunutu 20.04 (Gnome 3.36) -- I cannot find "postman" in "Activities".
  • Communicative Algebra
    Communicative Algebra almost 4 years
    Or rather: it only works some of the time. I've tried to pinpoint the problem, but it's escaping me. Sometimes creating an exact copy of the desktop file (i.e. using file system copy operation) solves the issue, sometimes not.
  • math2001
    math2001 almost 3 years
    relevant documentation: developer.gnome.org/desktop-entry-spec
  • ivo
    ivo over 2 years
    I am using Ubuntu version 21.04. It DID worked for me without any issues. That was sooo simple man!!! Thanks a lot for sharing. I created my icon/launcher for Android Studio to avoid run it manually from command line (nothing against command line - I love it actually, but...).
  • foerno
    foerno over 2 years
    thanks, it works. but i find it baffling that a modern desktop environment does not provide a GUI for a basic thing like that out of the box.