Useful Custom Actions for Thunar

A custom action in a file manager is some user defined commmand which can be apllied to selected files. In Xubuntu there are two predefined custom actions, 'Open Terminal here' and 'Find in this folder'. Both are pretty useful but it gets better when you can define your own. To define custom actions got to 'Edit' - 'Configure custom actions...' in Thunar. I have defined these additional actions:

  • Rotate images by 90°
    for file in %F; do (jpegtran -copy all -rotate 90 -outfile "$file" "$file"); done
    Requires jpegtran, which is included in libjpeg-turbo-progs in the ubuntu repositories and in libjpeg-turbo for Arch Linux. To rotate in the other direction add another action with '-rotate 270'.
  • Convert .wav files to .flac.
    for file in in %F; do avconv -i $file `echo "\`basename $file .wav\`.flac"` && rm $file; done
    Requires avconv from libav-tools or replace the command with ffmpeg. Also libflac is required. Deletes the .wav file upon successful conversion.
  • Play all files in a directory with vlc media player
    vlc %F
    Well, nothing special about that... but I find it incredibly useful.
  • To be continued...

For questions, corrections or suggestions send me an email to marcus@<this_domain>.