Add menu option to favoured app launcher in Ubuntu dock
Follow the steps below.
-
Copy
.desktop
file associated to your preferred application, sayapp-name.desktop
from/usr/share/applications/
to~/.local/share/applications/
. You can do this by running the following command in Terminalcp /usr/share/applications/app-name.desktop ~/.local/share/applications/
-
Open the
.desktop
file using a text-editor, for example by runninggedit ~/.local/share/applications/app-name.desktop
-
Look for a line beginning with
Actions=
. If there is one, appendMy-Custom-Action;
to it. Otherwise, add the following lineActions=My-Custom-Action;
-
Write the following lines at end of the file:
[Desktop Action My-Custom-Action] Name=Name of the Option Exec=command-you-want-to-run
For example, if you want to open Text editor, put
gedit
in place ofcommand-you-want-ro-run
. Save the file.
Click on "Activities" and search for the application.
Right-click on the application icon and select "Add to Favourites". It should be added to the Ubuntu dock.
Now if you right-click on the newly added application icon in the dock, you should see a "Name of the Option" entry in the context menu which should work as expected.
Similarly, you can other options by adding new Desktop Action
s and adding the name of the action to the Actions=
line. For more info see this.