Custom Actions for Thunar File Manager

The file manager Thunar allows users to create a custom actions and add these to the file and folder context menus. A great feature and perfect for improving workflow and or automating repetitive tasks.
Custom Actions
Here are some actions that you might find useful. They have been setup to work on Ubuntu but will most likely work on other Linux distributions. At the moment they are mostly related to processing images. The command can simply be copy and pasted. Adding a custom action.
Graphics
Compress PNG images
Name: Compress PNG
Command: pngquant –force –ext .png %F
File pattern: *.png;*.PNG
Appears if selection contains: Image Files
This action compresses multiple images or a single selected image. It replaces the original. Requires pngquant.
sudo apt install pngquant
Compress JPG
Name: Compress JPG
Command: jpegoptim -s m90 %F
File pattern: *.jpg;*.JPG
Appears if selection contains: Image Files
This action compresses multiple images or a single selected image. It replaces the original. Requires jpegoptim.
sudo apt install jpegoptim
Inkscape Export PNG
Name: Export PNG
Command: inkscape –export-type=png %f
File pattern: *.svg
Appears if selection contains: Image Files
This action will take an SVG and export this to PNG with the same dimensions as the SVG file. Requires Inkscape.
sudo apt install inkscape
Optimise SVG
Name: Optimise SVG
Command: svgo –pretty %F
File pattern: *.svg
Appears if selection contains: Image Files
Compress and optimise SVG files. Replaces the original. Requires svgo.
sudo npm -g install svgo
PNM to SVG
Name: Convert to SVG
Command: potrace -sn -r 90 –flat %f
File pattern: *.pnm
Appears if selection contains: Image Files
Convert PNM files to SVG. Requires potrace.
sudo apt install potrace
Split PDF
Name: Split PDF
Command: qpdf –split-pages %f %n-.pdf
File pattern: *.pdf
Appears if selection contains: Other Files
Splits a PDF into individual pages. Requires qpdf.
sudo apt install qpdf
PNG to TXT
Name: PNG to TXT
Command: tesseract %f %n txt
File pattern: *.png;*.PNG
Appears if selection contains: Image Files
Convert a PNG with text to a txt file. Requires tesseract-ocr.
sudo apt install tesseract-ocr
Adding Custom Actions
For information on adding a custom action in Thunar I would suggest the official documentation Adding a Custom Action