Archive for the 'Thunar' Category

Using Custom Actions in Thunar to Resize JPEG Pictures

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.

Custom Actions in Thunar

From there choose to add a new custom action.

Add Custom Action to Thunar

When the next dialog appears, fill out the Name and Description fields to your liking.

Naming the Custom Action

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

Set the Custom Action Command

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;

Custom Action - Appearance Conditions

Once that’s done, you can close the dialog, and right-click the nearest jpeg picture and resize it!

Resizing a JPEG file using the Custom Action

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!




Next Page »


My Photos

James getting dragged up the hill

Another insane run

img_0104

Insane run

More Photos

How many times has this site been visited?

  • 135,007 apparently

Site Stats