Ubuntu/Fedora: How to Add Applications in The Menus

ubuntu/fedora: how do I add applications in the menus?

Freedesktop.org (which provides some standards that GNOME and KDE conform to) says that shortcuts should appear in .desktop files. You can find out where an existing package puts its .desktop file(s) by using your system's package manager. For example, on Fedora:

$ rpm -ql transmission | grep desktop\$
/usr/share/applications/transmission.desktop

http://www.freedesktop.org/wiki/Howto_desktop_files is a tutorial that should help you get started.

Adding menu items to GNOME menu or Unity

I've found my silly mistake :) I forgot to give executable privileges to the desktop file. So after you give executable privileges to the desktop file by the command

chmod +x <desktop file path>

place it in

/usr/share/applications  /* So the menu option is available to all the user */

or

~/.local/share/applications  /* In this case the menu option is available only to that particular user*/

after you apply the executable permission, the desktop file will take the name and icon specified by you, in the .desktop file.

How can I put my GTK application in the desktop menus?

So basically this file will create a desktop entry for those configurations you provide for the corresponding directives in the file. Judging by your question, you are unable to find where to place your application executable in that directive.

Exec="/absolute/path/to/your/executable/file"

And the Name directive will hold the information of your application name. This is the one you will be querying for in your gnome applications search (which appears when you press the windows key).

This file will contain a .desktop extension. And this file itself is not executable. This will point to your application, making the gnome/ubuntu system understand that such application exists.

This will not directly create a desktop shortcut as in Windows, rather this will index your application which you can run from the application menu (ubuntu or gnome)

If you aren't sure where to place the file here's a hint from the documentation you linked.

Place this file in the /usr/share/applications directory so that it is accessible by everyone, or in ~/.local/share/applications if you only wish to make it accessible to a single user

Adding a new application group in linux

Maybe xdg-desktop-menu does that? See man xdg-desktop-menu or http://manpages.ubuntu.com/manpages/hardy/en/man1/xdg-desktop-menu.html .

Put Java application into file manager's context menu

If you target vanilla ubuntu, you can assume that the file manager is Gnome Nautilus.
You can write an extension (probably in Vala/C/python) to nautilus :

http://developer.gnome.org/libnautilus-extension/stable/

Or you could re-use existing extensions, like nautilus-action or nautilus-script which allow you to bind scripts to contextual-menu entries.

If you want to support all file managers out there, you have to look at dolphin(for KDE), thunar(for xcfe), and maybe pcmanfm...

Edit :
If you want to write your plugin in java, you might want to look at Gobject Introspection. Don't know if it works yet.

Standard Menu Item Location on Linux

Gnome puts them in /usr/share/applications. My personal ones seem to show up on ~/Desktop, but these all seem Wine-related. Some also show up in ~/.local/share/applications. The good people at freedesktop.org have a specification of what they should look like, but I can't find a standard about where they should go.



Related Topics



Leave a reply



Submit