Steps to create a desktop file on Ubuntu:
1- Open any text editor, and type the following:
Name=XAMPP Control Panel 1.8.3-4
Exec=gksudo "python /opt/lampp/share/xampp-control-panel/xampp-control-panel.py"
Name[en_CA]=XAMPP Control Panel
Save this as xampp.desktop
Creating a desktop file is very simple, you can read more about it from this link:
2- And now as we have created a desktop file, we need to move it to applications directory, so it will be visible by unity launcher.
sudo cp xampp.desktop /usr/share/applications
3- We need to make it executable, so we can run it from launcher:
sudo chmod 777 xampp.desktop
4- now we have executable, but if you run it, you will see an error, and to solve it, we need to install two libraries, if you notices the Exec=gksudo "python /opt/lampp/share/xampp-control-panel/xampp-control-panel.py" in the desktop file, you will see that we used gksudo, which we need to install, and python-glade2 to run python file we have.
and this is can be done by running these two commands:
sudo apt-get install gksu
sudo apt-get install python-glade2
Thats it :).