Category Archives: Linux

Things I have learned about Linux distros…could be loves or hates

It puts the app in the menu…

I recently came across a neat little trick in Debian. I installed the Eclipse IDE and noticed that there was not a menu entry for it in Gnome3…so I did some Google-ing and found out about the command…

desktop-file-install

Basically, you create a file that will tell desktop-file-install about the menu entry, and desktop-file-install takes care of the rest!

Here’s an example configuration file called android-studio.desktop

[Desktop Entry]
 Name=Android-Studio
 Comment=your comments
 Exec=/opt/android-studio/bin/studio.sh
 Icon=/opt/android-studio/bin/idea.png
 Terminal=false
 Type=Application
 Categories=Utility;IDE;Development;

Here’s the quick rundown of the non-obvious features of this configuration…

  • The line beginning with “Terminal” specifies whether the app should run in a terminal window.
  • The line about icons…I believe this to be an absolute path to the icon.
  • The comment is a description of the app and will also become its tool-tip
  • The categories line needs to have a valid category; you don’t make these up as you go along.

There is not a whole lot of complexity behind this command. You can read more about it on the Gnome Developer site.

After you create the file open up your terminal and navigate to the .desktop file you created. Execute

desktop-file-install android-studio.desktop

Now go check your menus. *You may need to run the command as sudo or root in order for the entry to show up.

And there ya have it, putting a new entry in the main menu of Gnome3. Thanks for reading 🙂


Resources: