Garrett's answer almost works for me, but instead I have to use
StartupWMClass=sun-awt-X11-XFramePeer
This still gives an extra launcher icon while the splashscreen is visible (because the WM_CLASS of the spashscreen is just "MATLAB"), but then the window gets properly grouped under the launcher.
New instances of Matlab (started by terminal, or Synapse, or from another tty with export DISPLAY=:0
) also get grouped under this launcher, and the launcher's quit option kills all of them.
I found this WM_CLASS value by using
$ xprop WM_CLASS
and then clicking on the Matlab window, a command I got from Superuser.
To prevent the temporary extra launcher icon, you can also add the -nosplash
flag after the -desktop
one.
So, my ~/.local/share/applications/MATLAB.desktop
looks like this:
[Desktop Entry]
Version=1.0
Type=Application
Icon=matlab
Name=Matlab
Comment=Start MATLAB - The Language of Technical Computing
Exec=matlab -desktop -nosplash
Terminal=false
Categories=Development;
StartupNotify=true
StartupWMClass=sun-awt-X11-XFramePeer
X-Ayatana-Desktop-Shortcuts=New_Window;
Name[en_US]=MATLAB
[New_Window Shortcut Group]
Name=start a new MATLAB instance
Exec=matlab -desktop
This is on Ubuntu 12.10, with Matlab R2012b
Oh... I found answer myself:
You can force MATLAB to load the newer version of the library provided by the operating system, by following these instructions:
- Identify the location where MATLAB is installed.
- Navigate to the
sys/os/glnxa64
directory within this installation folder.
- Rename
libstdc++.so.6
library to libstdc++.so.6.old
.
Best Answer
Try specifying the full path in the launcher you are using.
So for example if the output of
which matlab
is/usr/bin/matlab
, then change theExec
field toNote that if this does solve the issue for you it's likely because you have a script called
matlab
that is shadowing the originalmatlab
command and so perhapsmatlab
is not receiving the-desktop
flag which it needs to run when launched without a terminal.See this entry for more details about getting the launcher to start properly by using
-desktop
.If for some reason you still get nothing, try setting the
type
field to terminal application to diagnose the problem further.