[Thunar-dev] Conditional "Open" command

Erik Harrison erikharrison at gmail.com
Sun Nov 4 18:58:54 CET 2007


On 11/4/07, Mathias Brodala <info at noctus.net> wrote:
> Hi.
>
> Imagine the following situation: you have two files in a directory, a video and
> a subtitle file for this video.
>
> Now just calling, e. g. mplayer with these two files won't do since it requires
> the "-sub" option to recognize the subtitle file.
>
> Creating a custom action also doesn't work since the custom command won't be
> displayed as soon as both the video and subtitle file are selected. (Pattern:
> "*.ass;*.srt;*.ssa", for video and text files)
>
> Any idea how I could accomplish this in Thunar? It would be great if Thunar
> could do all of this by itself and required me only to select the usual "Open"
> action.
>

Hmmm. I've thought about it for a few minutes, and I can't work out a
reasonable way to make this work from the UI of thunar. For instance,
in this case, Thunar would have to know which files to put in what
parts of the command. If Thunar was smart it could do it by MIME type,
but building that into the UI might be complicated. It could do it by
the order in which the objects are selected, but that's damn finicky.

There is the possibility of extending the .desktop files so that an
app could say "Hey, I open multiple files of mixed MIME type in a
special way, if MIME types are foo, bar and baz, then use these
command parameteres". Dunno.

However, in the short term you could do something like, if your
subtitle files are named consistently, have Thunar give you a "Open
with subtitles" whenever JUST a video file is selected. Then the
custom action could figure out the subtitle filename automagically.

>
> Regards, Mathias
>
> --
> debian/rules
>
>
> _______________________________________________
> Thunar-dev mailing list
> Thunar-dev at xfce.org
> http://foo-projects.org/mailman/listinfo/thunar-dev
>
>
>


-- 
Erik
"Look at me still talking when there is Science to do"



More information about the Thunar-dev mailing list