I am not sure to understand that command. Why do you put -- before the %F?
Try this:
xfce4-terminal -e "parallel avconv -i '{}' -map 0:1 -c:a copy '{}.m4a' ::: %F"
Explanation: As I understand the %F is what Thunar replaces by the files, and parallel uses ::: for the input.
One example in the manpage is, precisely
parallel gzip {} ::: file1 file2
To add to Thunar custom action a command like the one from here
for i in *.mp4; do avconv -i "${i}" -map 0:1 -c:a copy "${i%.mp4}.aac"; done
first add that into an executable script, like
#! /bin/sh -e
for i in *.mp4; do avconv -i "${i}" -map 0:1 -c:a copy "${i%.mp4}.m4a"; done
Make it executable and save it.
In Thunar custom actions add a new entry with the command bash /path/to/the/script %F
and the following conditions:
This needs separate custom actions for each file type (because it is limited to mp4 to m4a: make changes accordingly for flv to m4a, webm to ogg, avi to mp3 etc) but has the advantage that the output keeps the exact input name (file.mp4 becomes file.m4a), while with the first command does not (file.mp4 becomes file.mp4.m4a).
You could use the string manipulation features of bash, by running your command through bash:
bash -c 'avconv -i "$0" -map 0:1 -c:a copy "${0%%.*}".m4a' %f
(I'm assuming that your file manager will pass a filename like foo bar.mp4
as a single argument.)
Note that bash
has both ${var%%suffix}
and ${var%suffix}
- the former is greedy (foo.bar.mp4
will become foo
with the first and foo.bar
with the second). In this case, I'm aiming to use the latter, and assuming that %%
will be replaced by %
by the file manager since %
is apparently a special character here.
Best Answer
Custom Thunar actions are stored in
~/.config/Thunar/uca.xml
; copying that file elsewhere will provide a backup that you can restore in future simply by copying it back.When restoring a file, it’s worth checking to see whether the system you’re copying the file to has any interesting actions of its own (e.g. from new defaults in a newer version of Thunar). Each action in the file is stored as an
<action>
XML element; by copying these elements (<action>
, the corresponding closing</action>
and all the text in between), individual actions can be copied, or all the actions from the backup can be merged with the actions of the file in place.