Convert to JPG Image Files in Thunar

Jump Straight In!

Basic Tab

Appearance Conditions Tab

To add a custom action open Thunar file manager from the menu select Edit -> Configure custom actions…

The Bash Script

The examples on this page use the bin directory within the user’s Home directory. Home -> User -> bin. Place the script in the bin folder.

What You’ll Need:

  • Thunar File Manager: (Part of XFCE desktop environment)
  • ImageMagick: A free, open-source software suite, used for editing and manipulating digital images.
    • Installation: Open a terminal and run: sudo apt install imagemagick (or the appropriate package manager command for your Linux distribution).
  • Bash Shell: (Typically pre-installed on most Linux distributions)
  • A location to store the script. The recommended location is in your user’s bin directory (/home/<your_username>/bin).

Creating the Custom Action in Thunar:

  1. Open Thunar Configuration: From the Thunar menu, select Edit -> Configure custom actions….
  2. Add a New Action: Click the “+ Add” button to create a new custom action.
  3. Configure the Action Details:
FieldValueDescription
Name:Convert to JPGThe name that will appear in the right-click menu.
Description:Convert images to JPG using ImageMagickA brief explanation of what the action does.
Command:bash /home/<your_username>/bin/convert-to-jpg.sh %N

(Replace <your_username> with your actual username)
This command executes the convert-to-jpg.sh shell script located in your /home/<your_username>/bin/ directory. The script takes one argument, %N, which represents the filenames of the image you want to convert. The script converts the image using ImageMagick and saves the result as a JPG file.
Appearance Conditions Tab – File Pattern:*.png;*.PNGThis allows the action to apply to PNG file type.
Appears if selection contains:Image FilesThis ensures the action only appears when you right-click on image files (e.g., JPG, PNG, TIFF).

The Bash Script (convert-to-jpg.sh – Save this as a file named convert-to-jpg.sh in your /home/<your_username>/bin/ directory):