Recommended way to restore appmenus?

Migrating to a new laptop and I can’t find a convenient way to restore all my old appMenus.

I’m referring specifically to the selection of app shortcuts I chose on my old machine. So in the Q menu, when you select a VM - the list of apps that pops up for that VM.

(Both machines are running 4.1. Although for some reason the Qubes Global Settings looks markedly different in the fresh install, so it may somehow be newer.)

It looks like everything is mapped in dom0 ~/.local/share/qubes-appmenus so I did a cp -r from my old restored dom0 into the new dom0 (from dom0 ~ cp -r /home-restore-yyyy-mm-dd-ttttt/dom0-home/user/.local/share/qubes-appmenus/* .local/share/qubes-appmenus/). This did not work so I tried logging out and back in, hoping the menu would resync, it did not.

The only thing I found that seems to maybe work is to launch a particular VM with qvm-run (since none even have the terminal available as a shortcut, grr) and then run qvm-sync-appmenus <VMNAME>. I say “maybe” because, although this does make the appmenu look right, there are for some reason redundant entries now in .local/share/qubes-appmenus/<VMNAME/apps, maybe this is nothing to worry about.)

BUT I have 72 VMs (this will be trimmed but will still be a large number). To do this for each VM seems a bit of a pain :-\ Although I suppose I could write a little script.

Is there any other way? Thanks for any tips.

I am extremely interested in this because I’m preparing my backup/restore strategy, so I have to ask 3 silly questions:

  • Did you try to copy /home-restore-yyyy-mm-dd-ttttt/dom0-home/user/.local/share/applications/ too?
  • Did you try to reboot Qubes after copying everything
  • I am not sure at all if it makes sense, but did you try if previous didn’t work, to run, yes 72 times,

qvm-sync-appmenus --regenerate-only VMNAME

2 Likes

Ah thank you! I did not know about this particular option for qvm-sync-appmenus. I should have checked the docs for that command.

So I tried rebooting, then your first bullet, then rebooting, then I tried the third thing. The third thing worked!

I don’t mind doing that command 72 times because unlike vanilla qvm-sync-appemnus it does not require the vm to launch. So I just did:

qvm-ls | awk '$1 !~ /^NAME$/ {print $1}' | xargs -n1 qvm-sync-appmenus --regenerate-only

Worked like a charm. Thanks again!

1 Like

No, thank you for bringing this up timely for me and not checking the docs for the command, hahaha.
I meant exactly on not loosing the time on firing up VMs.

1 Like