DAVIX Contributor Guide: Menu Items - secviz/davix GitHub Wiki
This will outline the basic step for creating new menu items and adding them to the XML file.
Ultimately we may incorporate subdirectories for each tool which will increase the complexity of adding a menu item but at this point we only have the following directories:
- Services (
davix2014-services-<tool>.desktop
) - Capture (
davix2014-capture-<tool>.desktop
) - Process (
davix2014-process-<tool>.desktop
) - Visualize (
davix2014-visualize-<tool>.desktop
)
Identify which category your menu item belongs under. In the case where a menu item falls under multiple categories (e.g., Chaosreader) then create separate menu item files for each category to allow the greatest flexibility.
Create file(s) for your new menu item following the category naming convention. For our example, Treemap, you would create the following file:
davix2014-visualize-treemap.desktop
The very base content for a menu item follows; cut & paste into your menu item files and then we will modify the appropriate values.
#!/usr/bin/env xdg-open [Desktop Entry] Version=1.0 Type=Application Terminal=false Exec= Name=
Modify the “Exec” and “Name” fields:
- Exec contains the command to execute the application; fully qualify your paths where required.
- Name is the text displayed for the menu item.
In our example we create this file:
#!/usr/bin/env xdg-open [Desktop Entry] Version=1.0 Type=Application Terminal=false Exec=/opt/davix/scripts/treemap Name=Treemap
Locate the section of the applications.menu file that contains the submenu for your category. Here’s an example of what the Process submenu section looks like:
<!-- DAVIX Process submenu -->
<Menu>
<Name>Process</Name>
<Directory>davix2014-davix-process.directory</Directory>
<Include>
<Filename>davix2014-documentation-wiki.desktop</Filename>
<Filename>davix2014-documentation-wikistatic.desktop</Filename>
<Filename>davix2014-process-afterglow.desktop</Filename>
<Filename>davix2014-process-argus.desktop</Filename>
<Filename>davix2014-process-chaosreader.desktop</Filename>
<Filename>davix2014-process-ipsumdump.desktop</Filename>
<Filename>davix2014-process-logstash.desktop</Filename>
<Filename>davix2014-process-nsmconsole.desktop</Filename>
<Filename>davix2014-process-padsreport.desktop</Filename>
<Filename>davix2014-process-p0f.desktop</Filename>
<Filename>davix2014-process-sagan.desktop</Filename>
<Filename>davix2014-process-scapy.desktop</Filename>
<Filename>davix2014-process-tcpreplay.desktop</Filename>
<Filename>davix2014-process-tcpslice.desktop</Filename>
<Filename>davix2014-process-tcpxtract.desktop</Filename>
</Include>
</Menu>
Copy one of the lines, revise so it references your new menu item and paste it into the list.
For our example, here’s a segment of the Visualize submenu:
<Filename>davix2014-visualize-tnv.desktop</Filename>
<Filename>davix2014-visualize-zenmap.desktop</Filename>
</Include>
</Menu>
We’ll copy/paste the row with <Filename>davix2014-visualize-tnv.desktop</Filename>
and change “tnv” to “treemap” in one row, then we have the following:
<Filename>davix2014-visualize-tnv.desktop</Filename>
<Filename>davix2014-visualize-treemap.desktop</Filename>
<Filename>davix2014-visualize-zenmap.desktop</Filename>
</Include>
</Menu>
Make sure to save your files and commit them to the repository!