Adding actions to Thunar’s “Send to” context menu (xfce)

Using Kdiff3 tool as example action to add to the SendTo menu of Thunar.

Create the following file in ~/.local/share/Thunar/sendto and name it <whatever>.desktop (I named mine ‘kdiff3.desktop’) :

# kdiff3.desktop - Integrate kdiff3 into
# the "Send To" menu.
[Desktop Entry]
Type=Application
Version=1.0
Encoding=UTF-8
TryExec=kdiff3
Exec=kdiff3 %F
Icon=kdiff3
Name=Kdiff3
# MimeType=text/plain;

 

The MimeType is optional so in my case (since you may compare any two files kdiff3, not just text) I commented it out.

After creating the above file (and restarting Thunar!) you will be able to select 2 or 3 files and send them to kdiff3 for comparison! To do this – right-click on the files you want to compare and navigate to to the menu shown in the picture below.

thunar-context-menu-add-item-to-send-to

3 thoughts on “Adding actions to Thunar’s “Send to” context menu (xfce)

  1. Custom Actions works … kinda … but there’s a catch (or two catches actually):
    1. On the Advanced tab it is necessary to check all the checkboxes (Text Files, Other Files, etc);
    2. Once you’ve saved your custom action, close all instances of Thunar, re-open and then right-click on a directory and you will see the ‘kdiff3’ custom action. This is important, as I tried just selecting 2 files right after I saved the new custom action but right-clicking on the files did not display the ‘kdiff3’ custom action in the context menu. It showed up after I right clicked on a directory and then worked from that point on for any selection of files and directories.

    … AND …

    If you just want to do this without using Thunar – edit the file ~/.config/Thunar/uca.xml, and add a new section for kdiff. So your edited ucs.xml file will look like this:

    <?xml version="1.0" encoding="UTF-8"?>
    <actions>
    <action>
    <icon>utilities-terminal</icon>
    <name>Open Terminal Here</name>
    <unique-id>1663937147576993-1</unique-id>
    <command>exo-open --working-directory %f --launch TerminalEmulator</command>
    <description>Example for a custom action</description>
    <patterns>*</patterns>
    <startup-notify/>
    <directories/>
    </action>
    <action>
    <icon>kdiff3</icon>
    <name>kdiff3</name>
    <unique-id>1696331743604650-1</unique-id>
    <command>kdiff3 %F</command>
    <description></description>
    <patterns>*</patterns>
    <directories/>
    <audio-files/>
    <image-files/>
    <other-files/>
    <text-files/>
    <video-files/>
    </action>
    </actions>

Leave a Reply

Your email address will not be published. Required fields are marked *