Score:0

Where can app specific right click contextual menu be altered?

cn flag

I've been looking into this for a while now, and no matter which .desktop file I look into, I can't change the Ubuntu file explorer "new documents" contextual menu.

So I have chinese translated WPS launchers, but not a simple text editor. A possible solution here doesn't work.

Can somebody point me on the right direction, please?

Score:0
cn flag

The app specific right click contextual menu is defined in the .desktop launcher file of the application, which is effectively in use. On a system, multiple launchers with the same name may exist. Only one will be used. Only changes in that specific .desktop file will have effect.

.desktop launchers on your system matching the label you see in the Application Overviews or in your menu system (other Ubuntu flavours) can be found with a find command:

find / -name '*.desktop' -exec grep -H "Name=<what you see in the menu>" {} \; 2>/dev/null

Only .desktop launchers existing in an applications directory can be in effect. If you find multiple results, you already can discard those for which the directory path does not end with applications.

Then, for the remaining ones, a .desktop file residing under your home folder in ~/.local/share/applications will take precedence. Otherwise, precedence is determined by the order in which the parent directories of applications are listed in the variable XDG_DATA_DIRS

$ printenv XDG_DATA_DIRS
/usr/share/gnome:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop

Thus, a .desktop file living in /usr/share/gnome/applications will take precedence over a file with the same name in /usr/local/share/applications, etc.

vanadium avatar
cn flag
I will elaborate that part a little more in my answer
Andrea Moro avatar
cn flag
Thanks. Is the -H working with a sort of grep functionality? I get some results, but a: those are found in the timeshift folder and b) the description in in plain english which is fine (I instead want to get rid of Chinese labels)
vanadium avatar
cn flag
That find command allows to specifically find these .desktop files that would display what you currently see in the application overview. What is displayed there is what is after `Name=` in the corresponding .desktop file. So a good seach should retrieve results, at least one. The active one is where you can edit right-click menu options.
Andrea Moro avatar
cn flag
so to recap, I use the printenv and take the first directory, and then search with the find above? Though the find above looks from the root onward. Sorry, but I must be missing something.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.