# add menu items



## Beeblebrox (Nov 6, 2011)

Many ports (even when they are GUI based) fail to create the relevant menu item.  Alacarte under gnome is not very good and almost completely useless when you need to add an installed package as a menu choice.

A script to search installed ports/packages (like portmaster does) and give a "found these items" selection perhaps?


----------



## wblock@ (Nov 6, 2011)

If you mean DESKTOP_ENTRIES, they ought to be part of the port, to be added on install and removed on deinstall.  The ports system has code to do that, but it's up to the maintainer to use it.  Could you give an example of one that's missing?


----------



## SirDice (Nov 7, 2011)

There are a whole bunch of ports that don't create desktop entries 

But they are easily created..

Just add a *.desktop file in /usr/local/share/applications/ like so:

```
[Desktop Entry]
Encoding=UTF-8
Name=URxvt
GenericName=Rxvt Unicode
Comment=Use the command line
TryExec=urxvt
Exec=urxvt
Icon=lxterminal
Type=Application
Categories=GTK;Utility;TerminalEmulator;
```


----------



## wblock@ (Nov 7, 2011)

SirDice said:
			
		

> There are a whole bunch of ports that don't create desktop entries
> 
> But they are easily created..
> 
> Just add a *.desktop file in /usr/local/share/applications/ like so:



Even easier in the port Makefile.  Maintainers are generally pleased to receive diffs with those.  Some are not aware of the DESKTOP_ENTRIES feature.


----------



## Beeblebrox (Nov 7, 2011)

@wblock:  erm... Not understood - this is re port developers' (not me) usage of DESKTOP_ENTRIES?


> Even easier in the port Makefile




@SirDice:
Yeah thanks for sharing some of the frustration! You install some ports then some days later sort through /var/db/ports-or-pkg to find what-the-hell-v3/wasit-i-installed. I now plan to keep a separate list on paper tracking installed vs. no-gui-icon.

Anyways, I presume your instruction for *.desktop means: * = *urxvt* ? So one would
1. Add line items as you posted and change *urxvt* to the command in CLI
2. save as portname.desktop in /usr/local/share/application


----------



## wblock@ (Nov 7, 2011)

Beeblebrox said:
			
		

> @wblock:  erm... Not understood - this is re port developers' (not me) usage of DESKTOP_ENTRIES?



Port maintainers can add a single entry in the port Makefile to easily create them.  Better yet, no other changes are required to the other port files, and the menu entry is automatically removed when the port is deinstalled.  See the Porter's Handbook.

If you add one of these, send a diff to the port's maintainer.


----------



## SirDice (Nov 8, 2011)

Beeblebrox said:
			
		

> Anyways, I presume your instruction for *.desktop means: * = *urxvt* ? So one would


In case of my example that would be an appropriate name. The name of the file itself is not important though. You can name it whatever you want as long as it ends in .desktop.



> 1. Add line items as you posted and change *urxvt* to the command in CLI


You create one of those files for each menu entry you want.



> 2. save as portname.desktop in /usr/local/share/application


Yep.


----------

