Xfce Forum

Sub domains
 

You are not logged in.

#1 2023-02-25 16:56:01

m3cubo
Member
Registered: 2023-02-25
Posts: 5

[Solved] ✎ How to customize the Contextual Menu of the XFCE Desktop

Hello everyone,

I'm having some trouble with XFCE desktop custom actions. I've successfully added some custom actions using Thunar's custom action editor, but I want also to remove some of the "default actions". Let's say I want to remove options like "Copy" and "Cut", to leave a more minimal contextual menu.

Image of Contextual Menu in XFCE

I was wondering if there is a configuration file where these "default actions" can be found, so I can remove them (and add my own in the same file).

Thanks in advance!

Last edited by m3cubo (2023-02-27 18:08:19)

Offline

#2 2023-02-25 18:49:32

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,990

Re: [Solved] ✎ How to customize the Contextual Menu of the XFCE Desktop

Hello and welcome.

That context menu is hard-coded - you can't remove the upper sections without changing the code. However, Custom Actions now allow you to create menus and submenus within that context menu. You can make it cleaner by adding only a "Custom Actions..." menuitem on the context menu and burying all the custom actions in the submenu.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Online

#3 2023-02-26 11:19:00

m3cubo
Member
Registered: 2023-02-25
Posts: 5

Re: [Solved] ✎ How to customize the Contextual Menu of the XFCE Desktop

Thanks for your answer, ToZ! I supposed it could be hard-coded. I founded this, so maybe I could try to build it later: https://askubuntu.com/questions/337225/ … -in-thunar

I have find a tutorial that you linked in another post (about submenus), so I will put it here in case is useful: https://wiki.xfce.org/howto/customize-m … _sub-menus

Also, I have another question. Did you see the "Ø Digi" label in the image that I posted? That "Ø" should be the icon, which is correctly displayed in the Thunar window, but not in the Desktop. So, the name of custom action (Digi) is shown, and also the script associated is running fine. Did you know why the icon (which is an absolute path) is not displayed in the Desktop contextual menu?

Again, thanks for your help! (It is the first time I am registered in the forum, but your messages have been a help since I started using XFCE a few years ago)

Last edited by m3cubo (2023-02-26 11:27:21)

Offline

#4 2023-02-27 02:56:40

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,990

Re: [Solved] ✎ How to customize the Contextual Menu of the XFCE Desktop

m3cubo wrote:

Also, I have another question. Did you see the "Ø Digi" label in the image that I posted? That "Ø" should be the icon, which is correctly displayed in the Thunar window, but not in the Desktop. So, the name of custom action (Digi) is shown, and also the script associated is running fine. Did you know why the icon (which is an absolute path) is not displayed in the Desktop contextual menu?

What version of xfdesktop and thunar are you running?

As for the icon you are trying to use, is it one from your icon theme of a custom one? Can you post back the Digi section from your ~/.config/Thunar/uca.xml file?

Again, thanks for your help! (It is the first time I am registered in the forum, but your messages have been a help since I started using XFCE a few years ago)

No worries - glad the info was useful.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Online

#5 2023-02-27 14:15:33

m3cubo
Member
Registered: 2023-02-25
Posts: 5

Re: [Solved] ✎ How to customize the Contextual Menu of the XFCE Desktop

I'm using xfdesktop version 4.16.0, and Xfce 4.16.

This is the fragment of ~/.config/Thunar/uca.xml:

(I am using an absolute path, it's an icon inside my folder user (/home/mint/))

<action>
<icon>/home/mint/DESKTOP/Visual/Icons/Digi/Icon.png</icon>
<name>Digi</name>
<unique-id>1660931731098047-1</unique-id>
<command>exo-open --working-directory %f --launch TerminalEmulator</command>
<description/>
<patterns>*</patterns>
<directories/>
</action>

Last edited by m3cubo (2023-02-27 14:16:53)

Offline

#6 2023-02-27 15:12:37

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,990

Re: [Solved] ✎ How to customize the Contextual Menu of the XFCE Desktop

Can you try just using an icon name from your theme to see if it works (e.g. gtk-edit)? I vaguely remember a bug about icons using an absolute pathname in 4.16. Let me see if I can find it.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Online

#7 2023-02-27 17:42:42

m3cubo
Member
Registered: 2023-02-25
Posts: 5

Re: [Solved] ✎ How to customize the Contextual Menu of the XFCE Desktop

Yes, if I use a default icon it is shown in the Thunar window, and in the Desktop:

JzudR3D.png

Offline

#8 2023-02-27 17:52:48

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,990

Re: [Solved] ✎ How to customize the Contextual Menu of the XFCE Desktop

Try putting /home/mint/DESKTOP/Visual/Icons/Digi/Icon.png into ~/.icons (create the directory if it doesn't exist). And then for the custom action, just use "Icon".


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Online

#9 2023-02-27 18:06:33

m3cubo
Member
Registered: 2023-02-25
Posts: 5

Re: [Solved] ✎ How to customize the Contextual Menu of the XFCE Desktop

Thanks! I have created the ~/.icons directory, and stored the image there. Then, the image can be searched like this:

F7hX7gV.png

And then, the image appeared in the desktop menu of custom actions also, not only in the Thunar window.

Thanks ToZ! I will mark it as solved. Have a nice day!

Offline

Board footer

Powered by FluxBB