Accidentally deleted Qubes from KDE menu via "Restore System Menu"

In attempting to configure and customize my KDE application launcher, I hit the option to restore system menu option which wiped out all of the Qubes from both the XFCE & KDE application launchers.

I tried dnf remove and reinstall kdelibs & plasma workspace to no avail.

Can someone please advise me on how to remedy this?

Thank you.

@unman Sorry for the ping but I know you are the KDE man in this place.

Just to update my efforts:

I tried to set the menu file as a custom menu file to ./etc/xdg/menus/qubes-applications.menu to no success.

All of my .desktop entries are still in .local/share/qubes-appmenus/*

So something I did when I asked it to restore the menu to system default has broken the link between these .desktop files and the .menu config.

Can anyone advise me on how to restore this?

I was having issues with the menu just being flaky (changes I made, including deleting ghost folders for qubes that didn’t exist any more, wouldn’t “stick”) so I hit the same reset option, figuring it would reset the menu to the default state, with all of my qubes at the top level, ready to be re-arranged into the folders I use. (I expected to have to recreate the folders. No big deal.) Instead, like you I found out it made all of the qubes vanish.

I unfortunately wasn’t able to figure out an easy way to get them back. I had to painstakingly re-install all qubes, at which point they’d show up in the default place in the KDE menu, and I could re-put them where they belonged.

This took a while but since almost all of my qubes are disposables, there was little for me to do. AppVMs I could get back without a reinstall by renaming them to something, then changing the name back.

1 Like

Thanks for your response. Yes I figured an re-installation was going to be the end game of this. That’s not all bad as it gives me a chance to tidy everything up.

Just a comical situation of being amazed and happy with how I was getting KDE setup to being very glad I have some basic understanding of how to execute things via qvm-run.

Me: “Let me get this menu seutp exactly how I’d like”
Menu: “Have you heard of CLI?”

No, You don’t have to reinstall all of Qubes.

You can either re-create your qubes (easy enough if they’re disposables) or rename, then change the name back, on those you don’t want to re-create.

Tedious but surely better than completely rebuilding your system.

Plus there is always the chance that one of the really knowledgeable people has a better answer for this. I’m just a guy who stumbled into the same mess and found a way (not necessarily the best way) to overcome it.

This does, by the way point up the desirability of a method to reset the menu–that doesn’t “forget” the qubes completely, but rather just puts them where they appear when KDE is first installed.

There must be some utility that scans the qubes on first installation and builds the menu. We know this, because it happens when we install KDE. We want to know what that utility is. Then we can run the thing we did run, followed by that, and be in good shape any time the menu starts acting wonky.

There is a command named qvm-appmenus which seems related to the menu.

Maybe using --create or --update for each VM may do the trick.

2 Likes

Reading the help for this implies it may be the “missing” utility I was thinking about. I suppose I could test it by deleting a VM from the menu and seeing if this will bring it back.

Definitely, anyone reading this, do the --help. It looks like --init, --create, --remove and --update could be relevant here.

EDIT: I picked a template of little importance, and did a qvm-appmenus --remove on it. It disappeared from my menu. I then did a --init on it–which reported that /home/user/.local/sharte/qubes–appmenus//apps.templates was created. Then a --create. It showed up…in its prior location, not at the top of the menu (as a fully new VM would). Only the qube setup entry appeared. (This is logical, you haven’t added anything to this new menu yet.) --update didn’t seem to do anything at least at this point; it may be useful in other situations.

I still had to go into settings and find the applications tab. It showed my old menu items (in my case just Xterm) in the right hand side (so something is still remembered after a --remove) but also claimed the app was not installed. Nothing at all was visible on the left side. Doing an update here or with qvm-update-menus fixed that; I now saw the full app list on the left and Xterm was on the right and showed as installed and it’s in the menu now.

Whether or not you can run this on --all and get menus back after trashing them as the OP (and I) have done, is something I really don’t care to test; it would take quite some time to get my menus back the way I want them if I have to individually refresh every qube.

1 Like

Thanks for responding @SteveC @solene!

I ended up just reinstalling Qubes and working from a fresh start. This provided a decent excuse to audit and clean up my Qubes.

I’m glad you have helped to flesh out some guidance for people in the future who may encounter this issue and aren’t in the same position as I was to reinstall.

2 Likes

…meanwhile, I will soon find out if using those commands will clean out “dead” VMs from the menu that won’t stay deleted in the menu manager from one run to the next.

1 Like

Sometimes a clean install helps to focus on how you are structuring your
qubes.
Cleaning the menu and approaching it in a different way can do the same,
if you do not wish to reinstall. You can create custom menu entries and
structure them as you wish - much easier to do this in KDE but it is
possible in Xfce also.

In this sort of case use qvm-ls --all --exclude dom0 --raw-list to
get the list of qubes, and then iterate over it with qvm-appmenus.
I use qvm-appmenus --init and qvm-appmenus --force --update to
restore the menu items.

I never presume to speak for the Qubes team. When I comment in the Forum or in the mailing lists I speak for myself.
1 Like

So do you find a way to make changes stick? Im stuck there. I manage to delete the ghosts by directly deleting files in ~/.config/menus/applications.merged and changing ~/.config/menus/applications-kmenuedit.menu. Also the KDE Menu Editor does stick name changes, its just order and folders that doesn’t. My applications-kmenuedit.menu has the changes I want, but somehow they are ignored. There may be another file to tweak? or anything that can help really. Im sick of disorder ):

Unfortunately, no, I couldn’t find a way to get rid of ghost qubes by issuing a qvm-appmenus command.

Sorry, I forgot to say so. I only remembered to try about two days ago.

It was me trying very hard to get rid of about thirty ghost qubes that caused me to do the “Restore System Menu” in the first place.

On the plus side, I did learn something else. Sometimes when you try to move a qube into a subfolder of the one it’s already in, it won’t stick, and you end up with a ghost qube where you wanted the qube to be. (Fortunately, it can be deleted without problem). The way to solve that one is to first move your qube outside of the folder it’s in, and then drag and drop it into the subfolder.