Fix "Add to Favorites" for custom apps in Ubuntu
There is no “Add to Favorites” option in Ubuntu dock for custom apps. You will learn how to create a custom launcher and add to favorites in the dock.
Content
- Add standard application to Ubuntu dock
- Add custom application to Ubuntu dock
- Create terminal launcher for custom application
Add standard application to Ubuntu dock
If you open any application from the Ubuntu menu and right-click on it in the dock, you will be able to pin it to the dock by selecting “Add to Favorites”:
The application launcher will stay there after you close the app. That’s is the way to get a quick launcher for any app. However, this approach doesn’t work if you install an application not from the Ubuntu repository.
Add custom application to Ubuntu dock
Let’s say you have installed an application using an executable file and not the repositories. If you launch such an application and try to add it to favorites in the Ubuntu dock, you won’t find such an option in the context menu:
I don’t know why you cannot add to dock custom applications by default. And the only way to add it is to create a launcher manually.
For that, you need to create a yourapp.desktop
file in /usr/share/applications/
:
sudo nano /usr/share/applications/yourapp.desktop
Paste the following content:
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Exec=/path/to/yourapp
Name=YourApp
Comment=Description of YourApp
Icon=/path/to/yourapp.png
Replace yourapp
with your application and save by pressing Ctrl+O, Enter and Ctrl+X.
Make this file executable:
sudo chmod +x /usr/share/applications/yourapp.desktop
Log out and log in.
Open the Ubuntu Dash menu and you should be able to find your custom application in the menu. You can launch it from the menu.
Also, if right-click on it, you should be able to select “Add to Favorites” and pin it to the dock panel:
Now, when you close this application, a quick launcher will stay in the dock panel.
Create terminal launcher for custom application
Additionally, you can also create a quick launcher for this application to run it from the terminal.
Just create a file with the path to your application in /usr/local/bin/
:
sudo echo /path/to/yourapp > /usr/local/bin/yourapp
Make it executable:
sudo chmod +x /usr/local/bin/yourapp
Now, if you run yourapp
anywhere in the terminal, your custom application will launch.
Let me know in the comments if you know a better way to create a custom launcher in Ubuntu.
Comments
karinathill
Now a days all kinds of videos and audios are edited with the help of DaVinci Resolve Studio Crack. It helps the new user a lout. This provide the access to three separate tools, including professional editing, video combining, and color correction.
karinathill CrackCut.com
karinathill
Now a days all kinds of videos and audios are edited with the help of DaVinci Resolve Studio Crack. It helps the new user a lout. This provide the access to three separate tools, including professional editing, video combining, and color correction.
karinathill CrackCut.com
Peter
This is one of those weird things that after all those years, the go-to solution is “Oh, just write a script with all the correct parameters, put it in the right place, and if it doesn’t work, lol that’s your problem.”
It’s only when I try to do anything in Windows, that I realize how good the rest of Ubuntu really is, though.
Nikita
Thank you! You saved me :)
Dev
Hi Average Linux User, Thank you for sharing this fantastic article on adding custom apps to the dock. I have downloaded this app called ClickUp, but it gets a new update with a unique version number every other week, and the exec path in /usr/share/applications//yourapp.desktop doesn’t work. For example, when I open this app called ClickUp-3.0.4.AppImage gets a new update with a different version number ClickUp-3.0.5.AppImage. Should I include a regex in the exec path? Or is there an alternative solution?
Dev
Hi Average Linux User, Thank you for sharing this fantastic article on adding custom apps to the dock. I have downloaded this app called ClickUp, but it gets a new update with a unique version number every other week, and the exec path in /usr/share/applications//yourapp.desktop doesn’t work. For example, when I open this app called ClickUp-3.0.4.AppImage gets a new update with a different version number ClickUp-3.0.5.AppImage. Should I include a regex in the exec path? Or is there an alternative solution?
#!/usr/bin/env xdg-open [Desktop Entry] Version=1.0 Type=Application Terminal=false Exec=/home/john/Downloads/ClickUp-3.0.5.AppImage Name=ClickUp Comment=ClickUp App Icon=/home/john/Downloads/clickup-logo.png
Paul
Create a symbolic link to the current version and use that in the desktop file. Each time you upgrade the software, delete the old link and create a new one.
Jonathan
Thanks for that. It worked really well, but when I first did it I left the app as “Yourapp” (I was trying to add Audacity). I did it again and got to add Audacity, but when I click on the icon it acually opens “Yourapp” - which is Audacity. I would like to remove “Yourapp” so that Audacity and its icon remain alone - are you able to tell me how to reverse my error?
VanDaemos
Thanks. Worked nicely
Average Linux User
👍
Rolando Garza
This also works (without the need for root permissions) if you copy
yourapp.desktop
to~/.local/share/applications
. This is useful if your app is only supposed to be usable by a single account.Average Linux User
Thanks for the tip.
jo
Thanks, it works for me and the Godot engine application !
LinuxNewbie
Thanks ALU! Your channel has been a great source to learn how to use linux. Great guide with clear instructions and without any clutter! Have a great day!
Average Linux User
Thank you, LinuxNewbie!
Nicolas O
Thank you! Worked like a charm. Video was well put together and easy to follow.
Average Linux User
Thanks, Nicolas!
Veronika
Worked for me to add Eclipse to favorites: Launch the application –> Right click on the status bar of it (on top of the opened window) –> chose “Move to workspace down” –> right click on the icon in the launcher bar –> Add to favorites
Hope will help ;)
Average Linux User
Thanks for sharing your experience, Veronika!
Mikael Laine
Thanks! This was an amazing tutorial!
Lucas
Tried that with Palemoon installed with gdebi from a deb package on Ubuntu 20.04. Worked fine for adding the app to the application menu, however it does not show the option to add to favorites on right clicking (when application opened in the dock). Any ideas? Thanks for the post, very useful
ArduinoShop.ca
I had the same problem with the Arduino IDE 2.0 beta, which is basically an appimage - the option to “Add to Favorites” does not appear (and the icon is different in the dock ).
Crod
I had same problem, this my solutions https://askubuntu.com/questions/813991/add-an-electron-app-to-favorites-gnome-shell
Sergi
I am trying to run a driver and it is asking me for root permissions… is there a way to avoid this? Thanks.
FG
This works for me on Ubuntu 20.04
no programming necessary
Tony
That did not work for me. I have tried the StartupWMClass didn't work. right click on running pgm was successful at adding to dock, but icon was wrong, and app didn't run, so that didn't work. Come one guys, this should not take hours to get to work. WHY Doesn't this work? it worked on 18, but functionality has been changed in 20. not cool
Ken
Thanks. This worked.
Slony
This worked for me, thanks a million FG!
Benjamin Schiller
Thank you! For me it's working fine on Ubuntu 20.04 with one little difference: add to favorites is only possible in menu with a right mouse click. But anyway, it works perfekt.
Jörg K
Thanks alot for the Howto, but i cant get the Icons to work. The Apps i use dont come with a Icon.png. Any idea how to make it work?
Nicolas
Thanks for this tutorial. It helps a lot! It worked fine on one of my pcs. But on the other it does this thing where it launches the app in a new icon : https://framapic.org/pznT6Br1niFX/mLkQHfQ97IRN.gif. Any idea what could be causing this?
Average Linux User
Hi Nicolas, Thank you for the comment. I do not experience that issue. I tested it with the Standard Notes AppImage:
Do you run any additional GNOME extensions?
Nicolas
Hi, Thanks for your response. I run a couple of extensions : alternatetab, Always zoom workspaces, Noannoyance, Quick close in overview and user themes. But even disabling them doesn't help. I'll keep digging and come back to you if I find the cause of the problem.
Daggerhart
Add this to your .desktop file:
StartupWMClass=Firefox Developer Edition
Average Linux User
Thanks for coming back and sharing it here.