I recently installed MATLAB on my computer. I found that while I could easily start MATLAB from the terminal, there was no executable file I could double click on to run it. So I created a Bash script to run MATLAB and then created a .desktop file and saved it in /usr/share/applications/
. Here's the content of that .desktop file:
[Desktop Entry]
Type=Application
Name=MATLAB
Hidden=false
Exec=Desktop/Programs/scripts/runMatlab.sh
Icon=/usr/share/icons/matlabIcon.jpg
Categories=Application;
If I look inside /usr/share/applications/
, I indeed see an executable file with the name MATLAB and the appropriate icon, and if I double click on it MATLAB will run just fine. However, if I type MATLAB into Dash, matlab.desktop appears as a text file. It doesn't have the correct name (MATLAB) or correct icon, and if I click on it Gedit will open instead of the file being executed.
How can I fix this?
I am using Ubuntu 14.04 by the way.
chmod +x matlab.desktop
? Same procedure as for .sh shell scripts.desktop-file-validate matlab.desktop
? It should show whether there are any errors in the .desktop file. If there is no output, the file is fine.