From the gnome shell source code: backgroundMenu(https://gitlab.gnome.org/GNOME/gnome-shell/blob/master/js/ui/backgroundMenu.js#L34) and popupMenu(https://gitlab.gnome.org/GNOME/gnome-shell/blob/master/js/ui/popupMenu.js#L885).
I successfully disable background menu by using gnome-shell extension. Please do the following steps:
Download my gnome-shell-extension.(https://github.com/chap-wong/gnome-shell-extension-disable-background-menu)
Place the metadata.json and extension.js to ~/.local/share/gnome-shell/extensions/disable-background-menu@git.wongwanchap.mo/ (create the folder if necessary)
Restart the gnome-shell by logout and login again.
open tweaks tool and go to extension and find Disable background menu extension and enable it.
I am not a expert, I have just recently learned about gnome-shell, and this is my first extension. (It is not even published to gnome-shell community yet.), currently it only works when dconf write /org/gnome/desktop/background/show-desktop-icons false.
For the other case, you need to do the same for nautilus menu.
引用自 https://askubuntu.com/questions/1185390/completely-disable-gnome-desktop-right-click
稍微翻一下就是想屏蔽掉ubuntu的右键桌面菜单,这个作者参考了gnome shell的两个js,自己开发了一个extension,就是第三个网址
错误的是我用的是ubuntu1804版本,gnome-shell的extensions文件夹已经不在上述~/.local/share/gnome-shell/extensions目录下了
而是在/usr/share/gnome-shell/extensions
按照作者说的在这下面创建disable-background-menu@git.wongwanchap.mo目录,并且将两个js脚本放进去,重启gnome(可以直接reboot),然后就可以在gnome-tweaks工具的界面的extensions里找到disable background menu这个选项,使能即可生效。
或者使用命令行 gsettings set org.gnome.shell enabled-extensions “[‘disable-background-menu@git.wongwanchap.mo’]” 也可以生效