How to add shortcut to shell script to Ubuntu Gnome dock

Tested on Ubuntu 20.04.3 LTS

Create a shell script in /path/to/my/shellscript/my_shell_script.sh

Add png icon to /home/<USER>/.icons/my-icon.png

Add a file to /home/<USER>/.local/share/applications named my_shortcut.desktop

File contents:

[Desktop Entry]
Type=Application
Name=MyShellScript
Exec=/path/to/my/shellscript/my_shell_script.sh
Icon=/home/<USER>/.icons/my-icon.png
Categories=Development;

Search in Applications – type „MyShellScript…” > Right-click > Add to favourites.

Done.