I’ve found it easier if you get the list of apps through dpkg. I document it in my pre-deja dup Librem 5 backup and restore post and actually run it in cron so I have an updated list of packages that end up in my home directory:
00 00 * * * dpkg --get-selections | grep -v deinstall | cut -f1 > /home/purism/pkglist
I still use this process for backup and restore when I’ve migrated between different iterations of the phone, and the process works basically the same for a laptop or desktop. I also have a Deja Dup daily task running that backs up my home directory just so I can recover from a mistake: