You can create custom launchers by adding .desktop
files to the folder ~/.local/share/applications
. (Since .local
starts with a .
, it is hidden from the ls
command unless you use ls -a
. You can also get to it in the Files application by hitting Ctrl-L to jump to the title bar and typing ~/.local/
and hitting enter.)
The specification for .desktop files is on freedesktop.org, including a sample. (But many of the fields aren’t strictly required.)
[Desktop Entry]
Version=1.0
Type=Application
Exec=gnome-terminal --geometry=80x25 -- /home/mattdm/.local/bin/connect-to-server
Icon=network-workgroup
StartupNotify=true
Terminal=false
Categories=Utility;
Name=Connect to Server
Comment=Connect to Server
which I use to connect to a server which needs to go through some hoops rather than just a simple ssh connection (the command /home/mattdm/.local/bin/connect-to-server
jumps those hoops and is executed when the gnome-terminal shell starts — just like you are looking for, it’s an app with extra command-line parameters added.) I also changed the icon so I can easily tell this apart from the normal terminal icon.
You’ll find that this is where Steam and other programs also drop their own desktop entries; for example, I have:
[Desktop Entry]
Name=Stellaris
Comment=Play this game on Steam
Exec=steam steam://rungameid/281990
Icon=steam_icon_281990
Terminal=false
Type=Application
Categories=Game;
as well.
Once you have a .desktop
file in place, you will be able to find it in the applications list in the overview. From there, drag it to the dock (or right-click and Add to Favorites).