I generally prefer XFCE desktop environment of Xubuntu, but I found its files right-click context menu too humble (no option to compress/decompress files for example, and I'd like some my very special actions there too).
How can I customize it?
The best way to do this is to use the excellent Thunar
You can either create a new custom action (see the discussion below) or edit an existing one. There are many useful examples at the Xfce site and at the Ubuntu wiki, so there is no need to go through them all here, but we will just discuss a few examples to display the usefulness of this feature in
You would create a new custom action by clicking the add button (shown in the first screenshot). Then you would put the below command, for example, in the command box (like I have done for a different example in screenshot 2):
and then make sure that the correct file types were selected in the Appearance Conditions menu (as I have done for a different example in screenshot 3).
The command above uses
However, to use a safer example than
(You can add an icon if you wish (see the screenshot below), so that the context menu looks more interesting.)
Now, only when you right click a text file, will the
There is so much more that can be done with custom actions, but this was just an introduction to the basic ways of creating your own context menu item. There is a lot more information at the Xfce wiki and a lot of useful examples, and there are also some excellent examples of custom actions in this forum.
To restrict a command to a certain type of files:
Thunar plugins cover a limited area of options.
The main way to add new context menu options is (as Mik said) done by going to 'Edit/Configure custom actions' - and clicking "+" to add.