While this question is a precise duplicate of another (How do I add new locations to "Files" launcher in Ubuntu dock?), I believe that it has been incorrectly marked as duplicate, and has never been satisfactorily answered. Therefore I am repeating it.
The supposed duplicate (How do I pin my favorite folders in Ubuntu dock like in Windows?) concerns pinning one location to the launcher. This question is about having several locations available under one 'files' entry on the launcher.
Can someone please give a step by step description of how to achieve this in 18.04.
In principle, one can add items to the right-click menu of a Dash launcher in Gnome-Shell by defining extra "Desktop Actions" in the .desktop file. To see this working, copy the .desktop file of Files (Nautilus),
/usr/share/application/org.gnome.Nautilus.desktop
to your hidden folder.local/share/applications
. After that, you can edit the local desktop file without the need to be root and without affecting other users of your system. This local copy will replace the system wide version on your launcher.If you open your local
.local/share/application/org.gnome.Nautilus.desktop
file in a text editor, you will already see an example of such action at the end of the file:This action represents the "New Window" item in the right-click menu of the launcher. Note that this action is declared earlier in the file, on the line
Actions=
.Thus, you easily can add your custom action:
places-documents
.~
). Thus, substitute your actual login instead ofyourlogin
.Add your action to the
Actions=
line:We would be ready if it were not that apparently, the command to open a folder will not work. At least it did not for me. This is apparently due to nautilus communicating through dbus. After changing the line
DBusActivatable
to false, it works for me:I do not know potential side effects of disabling the communication of Gnome Shell with nautilus through dbus. As long as you do not encounter side effects that are unacceptable to you, you will be good to go.