Make a file called testicon.desktop and place it on the desktop
$ more testicon.desktop
[Desktop Entry]
Version=1.0
Type=Application
Terminal=true
Icon=/home/robin/Desktop/testicon.png
Name=TestIcon
Exec=/home/robin/Desktop/testicon.sh
Comment=Some comment for en_GB
Name=TestIcon
Comment=Some comment.
Icon=/home/robin/Desktop/testicon.png
Here is an executable bash script. Place it on your desktop
and run it and it will describe making an icon that runs a script
$ more testicon.sh
#!/bin/bash
# this forces bash to use the Desktop directory i.e. where this bash script is located
cd "${0%/*}"
echo "to make a shell script run from an icon"
echo " make a file like this "
sleep 1
echo "====================================================="
cat ./testicon.desktop
echo "====================================================="
echo "called something like testicon.desktop"
sleep 2
echo " chmod +x the .desktop file"
echo " make a png file for the icon call it testicon.png"
echo " now right click on .desktop file and allow launching"
echo "should work"
sleep 10
echo "bye, disapparing in ten seconds"
sleep 10
NUC 2023-11-16_16:05 ~/Desktop
This works for
$ cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.6 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.6 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal