8

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;
Tom
  • 341
  • 1
  • 2
  • 7
  • You won't make a .Desktop file executable. Did you try little tool called alacarte to create a launcher ? – pLumo Aug 20 '19 at 14:47
  • 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. – Tom Aug 20 '19 at 14:48
  • example in GNOME documentation - https://developer.gnome.org/integration-guide/stable/desktop-files.html.en#ex-sample-desktop-file – Enrique René Jan 27 '21 at 01:10

2 Answers2

16

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.

Johnny
  • 103
Tom
  • 341
  • 1
  • 2
  • 7
  • This does not work for me on Ubunutu 20.04 (Gnome 3.36) -- I cannot find "postman" in "Activities". – Communicative Algebra Jul 30 '20 at 06:16
  • 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. – Communicative Algebra Jul 30 '20 at 11:33
  • relevant documentation: https://developer.gnome.org/desktop-entry-spec/ – math2001 Jun 05 '21 at 04:44
  • 1
    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...). – ivo Oct 06 '21 at 06:46
  • 2
    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. – foerno Nov 21 '21 at 13:46
1

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.

telometto
  • 1,975
Fugazza
  • 11