Observe:
- Open Files/Nautilus.
- Right-click on the Files icon in the Dock.
Result: In the context menu, you see All Windows at the top in its own section, New Window at the top of the next section (followed by a list of folders), either Add to Favorites or Remove from Favorites in the next section, and Quit in the bottom section.
Note: this content remains intact indefinitely. - Click Add to Favorites if necessary.
- Close the Files/Nautilus window.
- Right-click the Files shortcut in the Dock/Favorites.
Result: a similar context menu as before appears, except without the All Windows and Quit sections. See below for a screenshot. - Wait a few seconds.
Result: all folders disappear from the menu - the only remaining options are New Window and Remove from Favorites.
How do I prevent the folders from disappearing from this context menu?
sample context menu from step 5:
This works perfectly with Ubuntu 20.04 and older. However, with 22.04 and above, it does add the fixed shortcuts you create, but when you open Files/Nautilus it still adds all the default locations and bookmarks from the Files application in addition to your custom shortcuts. This results in many duplicates in my case and a very messy menu.
– James Jan 24 '24 at 15:44