How to add a shortcut (.desktop) to the Ubuntu 18.10 Dock

Add shortcuts to Ubuntu 18.10

Add shortcuts to Ubuntu 18.10

Until Ubuntu 18.04, Unity allowed us add shortcuts or .desktop files to your Dock. Personally I like the design of the new version much more, but I miss adding a shortcut to the Dock by simply dragging and dropping it on top of it. In Ubuntu 18.10 it is also possible to add shortcuts to the Dock, but we will have to do it in another way that requires more steps. But do not panic because it is actually very simple.

Until now it was enough to create a .desktop file and drag it to the Dock. What has not changed is that first we will have to create the .dekstop file. What has changed is that now we will have to leave it on a specific route and access it as if it were one more application. After the jump we tell you both how to create these .desktop files and where we have to leave them so that later we can add them as favorites to our Dock.

How to create a shortcut or .desktop file

  1. It will only be necessary to copy the following in our text editor and edit what is necessary from the example that we have below:

[Desktop Entry]
Type = Application
Terminal = false
Name = Xkill
Icon = / home / pablinux / Pictures / death.png
Exec = xkill
GenericName [es_ES] = Kill application

  1. From the above we have to edit:
  • Name: the name to display.
  • Icon: the image that we will see. The best thing is to use an icon, for what I search on the internet for what interests me + PNG so that it has no background. For it to be seen, it is important that the upper and lower case are the same as the path where the image is. I have "death.png" in my "Pictures" folder and my Linux user is usually Pablinux.
  • Exec: here we will add the command (or file indicating its path) that we want to execute. In the example I have xkill that will help me to kill a program that is not responding as it should.
  • GenericName: here we add a description of what we will do when executing the shortcut. I have done it for a long time and I remember that in some systems the text appears when I put the cursor on it.
  1. We will save the file with the extension .desktop so that it can work.
  2. Once saved, we will right click on it and give it permission to run as a program. You will see how the image that we have configured previously is shown.
Allow to run as a program

Allow to run as a program

  1. The shortcut is ready to go, but no matter how much we drag it to the dock, it does not stay. What we have to do is put it in the folder .local / share / applications that is inside the personal folder of our user. If we don't see it, we press Ctrl + H to show the hidden files.
Add shortcut to the Dock

Add shortcut to the Dock

  1. And we almost have it. It remains to click to the right of the Dock to see all our applications and, from there, add to favorites. In the screenshot you see "remove from favorites", but because I already have it added. And it would look like this:
Ubuntu dock

Ubuntu dock

We can also create accesses to execute files

In the red squares we have the two accesses that I currently have. The second is for convert images to JPG and change the size to 830 pixels wide, which is the format and size that works best here in Ubunlog. For this second access, no matter how much it adds to the line Exec I didn't catch the two commands, so I made a shortcut that would run a simple file that has both commands. In case you are interested, this text file only needs us to grant it permissions to run as a program and it has the following text:

cd / home / pablinux / Desktop
for file in * .png; do convert $ file -resize 830 $ file; convert $ file $ file.jpg; done

The meaning of the second line is explained in this link: With Imagemagick installed (it comes by default in Ubuntu), that means «for files that are inside the folder and are PNG, resize to 830 pixels wide and convert the file to JPG«. It's something that I use multiple times a day, so it's worth having your shortcut saved to the Dock.

What shortcuts do you have or will you add to your Dock?


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Carlos said

    Hello, thanks for the explanation, following it I made a launcher for eclipse.

  2.   Jc Morales Pena said

    Hello. Thanks so much for the explanation. It works perfect with various programs. However, I could not create or run applications or programs of the type .AppImage. I tried to configure a launcher with MyPaint.AppImage but failed. I had to do it with the Menu Editor program, which comes in the Ubuntu 18.04 repositories.

    Greetings.

  3.   Emerson said

    Ubuntu is great in many things, but in this it is a real pain
    I miss the ease of making a direct access to a web or a file

  4.   Juan Carlos said

    Thanks for the explanation. However "only" it worked for me with Eclipse, since with other applications such as openshot, packettracer, teamviewer. If it is true that a launcher is created, when I open it, it opens another icon with the application executed, that is, the icon is repeated. Someone knows how to correct the problem.

  5.   Beginner said

    Hello, excuse my ignorance but I stayed in step 5, I don't know how: put it in the .local / share / applications folder that is inside our user. I could not create the shortcut, thanks for the tutorial anyway and best regards

  6.   Jose juan said

    Hello. I am completely new to Linux. I have installed Lubuntu 18.04, a first cousin of Ubuntu 18.04. To create shortcuts (or launchers, as they are also called), it has been extremely easy for me. I have done the following: I have gone to the drop-down menu at the bottom left, there I choose the application I want to make direct access to, I press the right button of the mouse and a menu appears with the option «Add to desktop». Click and go to the folder «Desktop», where the shortcut has been created. Now you just need to drag it to the desktop and that would be it.

  7.   GG said

    FOR FUCK HOW THIS WINDOWS IS GOING TO BREAK THE ASS ALWAYS TO ALL FREE OPERATING SYSTEM