[Thunar-dev] Stripping file extension in custom actions

Benedikt Meurer benedikt.meurer at unix-ag.uni-siegen.de
Thu Mar 9 16:50:22 CET 2006


Jannis Pohlmann wrote:
>>My question probably is stupid, but I can't seem to find the answer,
>>so here I come : I'm trying to create a custom action that would
>>allow me to convert images to PNG format. So I created a custom
>>action using imagemagick :
>>
>>convert %n %n.png

There's no way to do this. There's simply no way for the file manager to
tell which part of the file name forms the extension, as you can have
any number of dots in a file name, and the MIME could have been detected
by content sniffing (i.e. no glob rule available).

> How about using a pipe ("|") and applying an awk or sed rule before
> passing the file to convert?

I'd suggest to write a simple perl script to do the job. You could even
post the script (or somewhere else), so others can reuse your script.

> - Jannis

Benedikt



More information about the Thunar-dev mailing list