Using only terminal commands, preferably without su privileges, is there a way to create a shortcut on Ubuntu desktop and specify the icon.png to be shown on the desktop for the new shortcut?
Edit to original question follows.
I have created register.sh which creates MyGame.desktop and copies it to Desktop folder. This works ok but I still have to press F5 to update the desktop view for the correct icon to be displayed. Is there a terminal command that updates the desktop view in the same way that pressing F5 does? Tried installing xdotool to 'press F5' but that doesn't seem to work in the following script.
register.sh
#!/bin/bash
cd /home/jah/MyGame
echo "[Desktop Entry]" > MyGame.desktop
echo "Name=MyGame" >> MyGame.desktop
echo "Type=Application" >> MyGame.desktop
echo "Categories=Game;" >> MyGame.desktop
echo "Terminal=false" >> MyGame.desktop
echo "Exec=/home/jah/MyGame/MyGame" >> MyGame.desktop
echo "Icon=/home/jah/MyGame/MyGame.png" >> MyGame.desktop
cp MyGame.desktop ~/.local/share/applications
chmod 755 ~/.local/share/applications/MyGame.desktop
cp MyGame.desktop ~/Desktop
chmod 755 ~/Desktop/MyGame.desktop
gio set ~/Desktop/MyGame.desktop "metadata::trusted" yes
gio info ~/Desktop/MyGame.desktop >gioinfo.log
xdotool key F5