So this is a follow on from my last post, where I used a simple bash script that will resize JPEG pictures into 1024×768 resolution (or whatever resolution you wish).
I want to customise this a little more, and incorporate it into Thunar’s Custom Actions. People do similiar things for Nautilus.
The first thing to do is create a folder for the script. I decided to put it in the configuration folder for Thunar, under a freshly made scripts folder.
When mousepad opens, just paste in the script. Don’t forget to set the script to executable.
mkdir ~/.config/Thunar/scripts
mousepad ~/.config/Thunar/scripts/resize1024×768 &
chmod +x ~/.config/Thunar/scripts/resize1024×768
Next fire up Thunar, and choose the Configure Custom Actions item from the Edit menu.
From there choose to add a new custom action.
When the next dialog appears, fill out the Name and Description fields to your liking.
Next step is to enter in the command to use for this custom action. Obviously we want to run our script, but in addition we also need to specify a command parameter that Thunar uses when executing the custom action.
For this action I decided to use the parameter %N, which passes the selected filename(s) (without the path). This way I can convert one file, or multiple files.
/home/liam/.config/Thunar/scripts/resize1024×768 %N
The last thing is to set the Appearance Conditions, which specify when Thunar will display the custom action. Remembering Linux is case-sensitive, the string I used was
*.JPG;*.jpg;*.JPEG;*.jpeg;
Once that’s done, you can close the dialog, and right-click the nearest jpeg picture and resize it!
You can find other useful scripts on the page dedicated to Thunar custom action.
After even further digging in the Ubuntu forums, I found someone who made a Zenity script to resize their pictures. So that’s next in line to do. It looks really quite nice!









