I’m a long time user of Ubuntu, and still can’t remember some simple tasks…like how to create a launcher icon on Ubuntu. Keeping a cheat sheet here, so I won’t forget next time Jetbrains pushes an update.

Btw this works for any kind of launcher, not just IntelliJ…

Step 1: Create a shortcut icon

touch /tmp/intellij2021.desktop
nano /tmp/intellij2021.desktop

Step 2: Edit shortcut

Replace the contents with your program paths. A Desktop Entry is a file that conforms to the desktop entry specification with Type=Application.

[Desktop Entry]
Version=1.0
Name=IntelliJ Idea 2021
Comment=IntelliJ Idea 2021 App
Exec=/home/ana/Programs/idea-IU-212.5284.40/bin/idea.sh
Icon=/home/ana/Programs/idea-IU-212.5284.40/bin/idea.svg
Terminal=false
Type=Application
Categories=Development

Be sure to change Name, Comment, Exec, Icon and StartupWMClass.

Some examples from google search include Encoding=UTF-8. That option is deprecated in the latest specification. It was used to specify whether keys were encoded in UTF-8 or in the Legacy-Mixed locale. 

  • Version of the Desktop Entry Specification that the desktop entry conforms with. This particular example conforms with 1.0. I tried the 1.5 version but desktop-file-install reports an unsupported error.
  • Name represents name of the application.
  • Comment is description/tooltip of the application.
  • Icon should define an absolute path to icon that shows in menus, file manager etc.
  • Exec specifies an absolute path to executable, or program to execute, possibly with arguments. 
  • Terminal indicates if the program runs in a terminal window.
  • StartupWMClass If specified, it is known that the application will map at least one window with the given string as its WM class or WM name hint
  • Type – There are 3 types of desktop entries: ApplicationLink and Directory.
  • Categories
    For a list of valid Categories, see https://specifications.freedesktop.org/menu-spec/menu-spec-1.0.html#category-registry. Multiple categories are divided by semicolon.

Other possible keys are enumerated in https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s06.htm.

Step 3: Install the desktop icon

For the current user:

desktop-file-install --dir=$HOME/.local/share/applications ./intellij2021.desktop

Or for all users:

sudo desktop-file-install /tmp/intellij2021.desktop

Done

You should see your icon appear next time you click the launcher.


Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x