I wrote a bunch of bash scripts a while ago, and struggled with this issue as well. This is what I have going now, and it works:

This icon is located in ~/.local/share/icons. In this case it's a .svg file, but it will also work with other types: This is a python example:

And these are the results:

The general idea is to put the icon file in the icons folder, maybe also reload the icon cache, and refer to that image in you commands by its name (using the full path will not work), without the extension.

So, your command should look like this: