Custom package install script for distro hopping?

Hello everyone. I still have held off installing EndeavourOS because I am in a work hurry and I am afraid to spend to much time customising an installation when I really need everything to be working so I can. Serendipitously, my employer just sent me a new windows laptop as part of the regular replacement cycle and they do not really want the old one back (I need a windows machine one for all their custom apps and their private VPN but all my real work is done on a linux machine). That opens up my old windows machine to wipe and install Endeavour without buggering around with my linux machine that is working how I want it now.

So now that you know my life story, my question is:

Is there a template around that anyone can recommend that will detect all the apps I have installed on my manjaro linux computer (e.g. brave, vbox, rstudio, teams, zoom), and create a shell script that I can take to a new machine and run to install them? This would make my migration a lot less random.

thanks again.

If your pacman.log is intact then this is what I used to use on Manjaro:

comm -12 <(grep -Poe '\[ALPM\] installed \K\S*' /var/log/pacman.log | sort | uniq) <(pacman -Qeq | sort)

It is worth noting is probably going to need some tweaking because there are packaging differences between EOS and Manjaro.

Once you clean up the list you can simply send the list to yay. If you need an exact command I can provide it.