Setup application launcherand default applications from terminal

Hello,
I have made a post in reddit of kde, without much luck.
I am looking to do some setting up from the terminal for the application launcher, I would like to:

  1. create a custom submenu with setting up an icon and a name
  2. I create some .desktop files for some applications (in ~/.local/share/applications) this works fine, but I would like to send them directly inside the custom submenu created in 1.
  3. clean all existing favorites from the application launcher
  4. setup some defaults for some extensions to a .desktop file, for file extensions that already exists such as STEP (so in this case set a new default to a existing one) or for other formats that do not have any default applications at all.

today I can partially successfully do 2:
as I can create the desired .desktop and set it in a submenu, but this works only for the default ones? or maybe I am not creating correctly the submenu in 1.
what I tried was to create in ~/.local/share/desktop-directories a .directory file which looks like this:

[Desktop Entry]
Comment=
GenericName=
Icon=iconPath
Name=CustomName

but when I create my .desktop and I set Categories=CustomName the custom submenu is not shown and the .desktop (from memory) appears in the lost and found submenu instead so this makes me think that I am missing setting the custom submenu somewhere elseā€¦
thanks in advance!