Create Gnome menu entry

# login as root
sudo su
 
# create group
cat <<EOF>/etc/xdg/menus/applications-merged/my.menu
<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN"
"http://www.freedesktop.org/standards/menu-spec/menu-1.0.dtd">
<Menu>
  <Name>Applications</Name>
  <Menu>
    <Name>my</Name>
    <Directory>my.directory</Directory>
    <Include>
      <Category>my</Category>
    </Include>
 
        <Menu>
            <Name>my-sub</Name>
            <Directory>my-sub.directory</Directory>
            <Include>
                <Category>my-sub</Category>
            </Include>
        </Menu>
 
  </Menu>
</Menu>
EOF
 
# create directory for entry
cat <<EOF> /usr/share/desktop-directories/my.directory
[Desktop Entry]
Type=Directory
Name=MyMenu
Icon=emblem-favorite
EOF
 
# create sub directory for entry
cat <<EOF> /usr/share/desktop-directories/my-sub.directory
[Desktop Entry]
Type=Directory
Name=MySubMenu
Icon=folder
EOF
 
# create application starter and add to my entry
cat <<EOF> /usr/share/applications/myapp1.desktop 
[Desktop Entry]
Name=MyApplication1
Exec=nautilus
Icon=system-file-manager
Terminal=false
Type=Application
Categories=my;
EOF
 
# create application starter and add to my-sub entry
cat <<EOF> /usr/share/applications/myapp2.desktop 
[Desktop Entry]
Name=MyApplication2
Exec=nautilus
Icon=computer
Terminal=false
Type=Application
Categories=my-sub;
EOF
 
# Links
https://wiki.matusov.sk/?id=howto/gnome-menu-edit