Can someone please help me or assist me in making a script to replace the default menu in use ??

Hello,
I wish to make a script to be run on the command line, or before an install, to modify the default menu and default menu icon in use on a KDE and Gnome desktop ?

For example,
In KDE upstream version, the default menu use is the one that most people know, the " KDE Application launcher ", I wish to replace it by default to the " Traditional menu based application launcher ", these 2 menus look exactly the same in the list of widgets available for the KDE panel, but are very different in look in style ! … and I also wish to be able to change the default menu icon ( the KDE one ) with my own, by default, for all users ? …

Does one know, from the command line, which file would contain that default configuration information and offcourse, be able to change it just by running a script before launch or before an install ( like in SUSE Studio for example ) to change the argument used in such a file … ??? … Please advise … I wish to do the same thing with the gnome desktop ??? … I am almost sure it would be the same approach but a different file would need to be change by a similar script !!

Please advise … any cues on that matter will be greatly appreciated.
:question:

thx

To change the default menus, export the variable XDG_CONFIG_DIRS to a location of your choice containing a directory called menus and the file that defines the menus. The default location ist /etc/xdg, meaning that the files in /etc/xdg/menus will be evaluated. The name of the applications.menu file to be used (for KDE, Gnome, XFCE, LXDE) may be prefixed with the value defined in XDG_MENU_PREFIX (For gnome3, it may be necessary to explicitely set this value to an empty string to be able to use classical menus in fallback mode). You may also change all the menu entries as well by exporting the variable XDG_DATA_DIRS (default is /usr/share/applications). I do it at a system level, but one can also do it at a user level. Before doing anything wth KDE and Gnome menus, I recommend reading the freedesktop documentation carefully: Desktop Menu Specification