I have Matlab installed under /home/fer/Matlab
, with the main exec file being /home/fer/Matlab/R2014b/bin/matlab
. There is something weird with it and it only works if I open it with the terminal using sudo
. If I run it without sudo it throws a permission error and closes (I guess it's reading somewhere).
Anyway, I was trying to create a .desktop
file to be able to open it from the menu, and because it needs to run under sudo, in the exec line I wrote:
Exec=gksudo -u root /home/fer/Matlab/R2014b/bin/matlab
When I click on the shortcut, it asks me for my password, then the Matlab splash appears, then closes, and nothing happens. This looks a lot like a problem with Matlab itself, but am I doing it right with the exec line of the .desktop file? Do I need to add anything else? If a program requires a terminal to run from, is there anyway I can emulate one from the desktop file?
EDIT: As asked in comments:
whoami outputs fer
and all files and subdirectories in Matlab/R2014b are owned by user fer
and group fer
. The error is written in a Matlab window, saying tht there is not write permission on /home/fer/.matlab/R2014b/temp0x... I will try to look into that directory.
ls -la /home/user/Matlab
– A.B. Apr 19 '15 at 10:50-u root
argument ofgksudo
, as it runs the following executable as root by default, if no user is specified. – Byte Commander♦ Apr 19 '15 at 10:56sudo
, do you get any error messages like "permission denied on /path/to/file"? That would be helpful to see what it wants to access and changing your user account's permissions to be able to access this file or directory. – Byte Commander♦ Apr 19 '15 at 10:59whoami
andgroups
. – A.B. Apr 19 '15 at 10:59