Pages

Saturday, March 10, 2012

Creating launcher for Matlab/any application in Linux: Fine and easy


 Hello folks,
In this post we'll a small lesson on
"How to create a launcher for an application".
In few application's we'll find no application launcher will be installed or copied in to the system.
For example here we'll take MATLAB as an example.
To open such type of applications we have run the required binary file in the terminal.









For example to open MATLAB we have to run the following command in terminal




1.ctrl+alt+t will open terminal
2.cd /<matlab installed folder>/bin
3. sh matlab or ./matlab
In my previous post (click here for that) i have explained how to get it done automatically by downloading and copying the files which are prewritten.
Here we shall see a simple script for doing the same thing without downloading anything. This helps people without internet.
For doing this we require a text editor and an icon image.
This is common for any application launcher creation.

Step 1: Open gedit (a text editor) and write the following lines

#!/usr/bin/env xdg-open
[Desktop Entry]
Type=Application
Icon=/usr/share/icons/matlab.png
Name=MATLAB R2011a
Comment=Start MATLAB - The Language of Technical Computing
Exec=/Matlab/bin/matlab -desktop
Categories=Development;

For Other applications replace the line against Exec:

ex Exec=required file location

Step 2: Then save it as matlab.desktop

Step 3: Move it to the appropriate location "/usr/share/applications/"

use cp command for that " cp /<present locatin> /usr/share/applications/"

Step 4: Download the required icon image and place it in "/usr/share/icons/<filename>"
for matlab logo you can get in installed folder "/Matlab/toolbox/sl3d/mainpage/matlab_logo.gif"
That it we are done.


You can see it the dash for ubuntu user s and for linux mint user go from the menu-> development- >matlab or from the dash.
 

4 comments:

  1. Thanks, this has helped me to make my own launcher for matlab. All I had to do that was different was change the icon location, but no big deal.

    ReplyDelete
  2. wow... thanks for your tutorial. its work for me

    ReplyDelete
  3. You are the best...thanks

    ReplyDelete
  4. Work in ubuntu 15.10! Thanks!!!

    ReplyDelete