0

I installed Matlab R2014a on Ubuntu 14.04.1 LTS 64-bit without any problems; however the default entry in the dash could not be pinned to the launcher, so I sought an alternative solution and wrote my own /usr/share/applications/matlab.desktop files which has the following content:

#!/usr/bin/env xdg-open
[Desktop Entry]
Type=Application
Icon=/usr/share/app-install/icons/_usr_share_icons_hicolor_48x48_apps_matlab.png
Name=MATLAB R2014a
Comment=Start MATLAB - The Language of Technical Computing
#Uncomment the following line and comment the line after to
#force matlab to use the 32 bits architecture
#Exec=matlab -arch=glnx86 -desktop
Exec=matlab -desktop
Categories=Development;
#Uncomment the following line if you've got several matlab icons in the launcher
#StartupWMClass=com-mathworks-util-PostVMInit

My problem is that when I search for Matlab in dash I get double entries and I also checked the directory ~/.local/share/applications to make sure that I did not have a .desktop file there also. It turned out that the only .desktop file I had was the one I created myself, but the two icons kept being displayed despite my efforts to get rid of them by uncommenting the last line in the matlab.desktop file as suggested in Ubuntu Help. Yet the problem still persists and I have no idea why since on my other laptop which is also running Ubuntu 14.04.1 LTS 64-bit I did get exactly one icon in dash that can work flawlessly when dragged into the launcher. I am very curious about this problem and would like to hear your suggestions and comments.

enter image description here

Vesnog
  • 2,273
  • You must have two desktop files in ~/.local/share/applications and/or /usr/share/applications, with a different filename, but the same name in the Name= line. See this post: http://askubuntu.com/a/516346/72216 – Jacob Vlijm Jan 12 '15 at 07:16
  • 1
    @JacobVlijm Okay thanks for pointing it out I will let you know when I solve the problem. – Vesnog Jan 12 '15 at 16:39

1 Answers1

2

For anyone interested I am posting the solution to the problem. I have run the following command in /usr/share/applications and ~/.local/share/applications to find files containing the entry Matlab regardless of the case; I learned that trick from StackOverflow.

grep -Ril "Matlab" /usr/share/applications/

The output was:

/usr/share/applications/matlab.desktop

being the file I generated manually. However, when I ran the command in the other directory

grep -Ril "Matlab" ~/.local/share/applications/

The output was:

/home/ongun/.local/share/applications/com-mathworks-util-postvminit.desktop
/home/ongun/.local/share/applications/mimeapps.list

After checking the first entry (since it was a .desktop file) I found that it was the culprit and deleting it remedied the duplicate icon in Dash.

Vesnog
  • 2,273