Creating a Gnome Launcher

Posted by {"name"=>"Palash Ray", "email"=>"paawak@gmail.com", "url"=>"https://www.linkedin.com/in/palash-ray/"} on November 02, 2019 · 1 min read

A Gnome Launcher can be created by creating the below file in the Home/Desktop directory:


vim ~/Desktop/EclipsePhoton.desktop


with the below contents:


[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Icon=/path-to-my-icon/icon.xpm
Icon[en_US]=/path-to-my-icon/icon.xpm
Exec=/path-to-my-installation/eclipse
Name[en_US]=Eclipse
Name=Eclipse


Once you save, you should be able to see the Laucher Icon on the Desktop. The challenge is, sometimes, you need to set some environment variables before launching. You can do that using sh -c command as shown below:


[Desktop Entry]
 Version=1.0
 Type=Application
 Terminal=false
 Icon=/path-to-my-icon/icon.xpm
 Icon[en_US]=/path-to-my-icon/icon.xpm
 Exec=sh -c "GTK_IM_MODULE=ibus JAVA_HOME=/my/java/installation PATH=$JAVA_HOME/bin:$PATH /my-eclipse-installation/eclipse"
 Name[en_US]=Eclipse
 Name=Eclipse


In the above example, I am setting 2 environment variables:


  • GTK_IM_MODULE
  • JAVA_HOME


The above works for Gnome 3 and Mate Desktops