I recently downloaded IntelliJ IDEA and start the app by running . idea.sh. The app appears in the launcher while I'm running it, but for some reason when I right click on it I don't get a 'Lock to Launcher' option like I do with other apps.

How do I attach it to the launcher?

Is it because I'm running a script and not an executable directly that disables that option?

2 Answers 2


There looks to be 2 ways you can do this.

Method #1: manually create .desktop file

Yes you need to create a custom .desktop launcher for it. Here are the general steps:

  1. Create *.desktop file in /usr/local/share/applications (or /usr/share/applications depending upon your system).

    $ gksudo gedit <insert-path-to-new-file.desktop>
  2. Paste below text

    [Desktop Entry]
    Name=IntelliJ IDEA

    Edit Icon= and Exec= and Name=. Also Terminal=True/false determines weather the terminal opens a window and displays output or runs in the background.

  3. Put the .desktop file into the Unity Launcher panel. For this step you'll need to navigate in a file browser to where the .desktop file is that you created in the previous steps. After locating the file, drag the file to the Unity Launcher bar on the side. After making doing this you may need to run the following command to get your system to recognize the newly added .desktop file.

    $ sudo update-desktop-database

Method #2: GUI method

Instead of manually creating the .desktop file you can summon a GUI to help assist in doing this.

  1. install gnome-panel

    $ sudo apt-get install --no-install-recommends gnome-panel
  2. launch the .desktop GUI generator

    $ gnome-desktop-item-edit ~/Desktop/ --create-new

                      ss of editor


  • sudo update-desktop-databas should be sudo update-desktop-database
    – Trindaz
    Commented Jun 27, 2013 at 3:57
  • Also, the final line of Method #1 ($ sudo ...) shouldn't be there. After some guesswork I discovered that "Put this in unity panel" = Open the file browser and find the file created in step 1, then drag it to the "Launcher". "Panel" seems to be an ambiguous term in Unity depending on who you talk to.
    – Trindaz
    Commented Jun 27, 2013 at 4:02
  • @Trindaz - yes sorry for the lack of details I wasn't sure exactly how to do that step either in looking at another tutorial that same step was just as vague. I'll add the details as you described in that step. LMK if they look OK.
    – slm
    Commented Jun 27, 2013 at 4:05
  • This worked for my on 18.04 but trying on 19.04 and the configuration file opens as a text file! What a pain.
    – Quaternion
    Commented May 10, 2019 at 19:43
  • Quoting @MDMower from their comment (unix.stackexchange.com/questions/170823/…): Alternatively, if this application is only installed for the current user, it would be more appropriate to put the .desktop file in ~/.local/share/applications Commented Feb 5, 2020 at 17:13

The following is usable in my case, launching a shell script from a launcher, and keeps the shell window open.


  • This example is with mate-terminal, use gnome-terminal if it's the one on your system.
  • This example is with a php cli shell script, to get the idea, any command can be passed here.
  • One parameter is passed to the script, -h on this case.
  • Adding ; bash keeps the shell window open after the end of the script, for e.g.:

    mate-terminal --execute bash -c "php /home/lilith/Desktop/moon/MOON/moon -h ; bash"

Additional variations

To keep the window open, with the path set on the script's directory, use a cd before the command. For e.g.:

mate-terminal --execute bash -c "cd /home/lilith/Desktop/moon/MOON/ && php moon -h ; bash" 

This allows the launching of some additional commands without having to to remain in the current working directory.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .