DEV Community

Stack All Flow
Stack All Flow

Posted on • Originally published at stackallflow.com on

How to Add Custom ‘.Desktop’ Application Launchers to Ubuntu Dock?

desktopgnome-shellubuntu-dock

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 up to Ubuntu 17.04) they got removed from the dock 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;
Enter fullscreen mode Exit fullscreen mode

Best Answer

  1. Create a .desktop file (or, copy if you already have one ready), say my-chrome.desktop, in your ~/.local/share/applications/ directory. You may add the following lines to it for a simple, bare-minimum .desktop launcher
[Desktop Entry]
Name=My Chrome
Comment=Chrome my profile
Exec=google-chrome --profile-directory=Default
Icon=google-chrome
Type=Application
Terminal=false

Enter fullscreen mode Exit fullscreen mode

The keys are as described below

  • Name= Specific name of the application (For this particular example, I used “My Chrome” to avoid confusion with the already existing Google Chrome launcher. You can use any other name.)
  • Comment= A short description of the application
  • Exec= The command to execute in order to launch the application
  • Icon= Icon for the application (You can use an icon provided by your icon theme or an absolute path to an image file.)
    1. Click ‘Activities‘ or ‘Show Applications‘ and search for “My Chrome” (application name as per the Name key). It should appear.
    2. Right click on it and select ‘add to favourites‘. If 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 Ubuntu Dock (Add to Favorites)

The post How to Add Custom ‘.Desktop’ Application Launchers to Ubuntu Dock? appeared first on Stack All Flow.

Top comments (3)

Collapse
 
aitor profile image
dragonDScript • Edited

I'm writing a program that does this with a fancy GUI. I will link the github + download link when I have it.

It's almost ready, but it doesnt work yet: github.com/dragonDScript/dot-deskt...
I will create a github release once its ready

Collapse
 
stackallflow profile image
Stack All Flow

Looking forward to it.

Collapse
 
aitor profile image
dragonDScript

If you know rust and gtk-rs maybe you can contribute to it, i dont have the knowledge to fix a bug.