Modify the qube application settings via a script (terminal)

I am looking for a terminal solution to modify (purge, remove and add) applications to a newly generated appVM (auto-generated by script).

i.e.
A. adding Librewolf to Selected
B. removing Help from Selected
C. the already removed applications firefox-esr and thunderbird

man qvm-appmenus

       --get-whitelist
              Get a list of .desktop files corresponding to applications to be included in the menu.

       --set-whitelist PATH
              Set  the list of applications to be included in the menu.  The PATH can be either a path to file containing a list of .desktop files, or a single hyphen ('-') to read from
              standard input.

              --set-default-whitelist PATH Set the default list of applications to be included in the menus of VMs based on this template.  Should only be used for TemplateVMs .The PATH
              can be either a path to file containing a list of .desktop files, or a single hyphen ('-') to read from standard input.

       --get-available [EXPERIMENTAL] [REQUIRES --i-understand-format-is-unstable]
              List all available applications for the VM.  The current format is UNSTABLE.  The applications are listed as hyphen-separated pairs consisting of file name and application
              name.

1 Like

Here a solution that works for me:

echo "${apps_list}" | qvm-appmenus --quiet --set-whitelist - ${qube}
qvm-appmenus --update --force ${qube}  

Remarks: ${apps_list} must match the file name(s) in /usr/share/applications
it can be more than one but separated with space and with the file ending .desktop
“app1.desktop app2.desktop …”. It must be a list if you add one by one it will be overwritten - it expects a list.