Using %-style formatting in Thunar custom actions

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Using %-style formatting in Thunar custom actions

fliehen
Good day everyone,

I've got a quick question regarding Thunar's custom actions!
I've made an action to split audio files using shnsplit -- pretty easy:

shnsplit -f %f -t "%n. %t" -o flac %d/$(basename %f .cue).flac

However, the formatting following the -t option is meant for shnsplit, not Thunar! Which means %n gets expanded into the file name.
I've also tried using just %t, which is not used by Thunar, and that also breaks it. Perhaps it gets expanded into nothing.

Is it impossible to give certain programs %-style formatting via custom actions?
I've tried escaping using "\", to no avail.

Thank you very much,

--
fliehen <[hidden email]>
_______________________________________________
Thunar-dev mailing list
[hidden email]
https://mail.xfce.org/mailman/listinfo/thunar-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using %-style formatting in Thunar custom actions

Mathias Brodala
Hi,

fliehen schrieb am 09.06.2017 um 14:15:
> shnsplit -f %f -t "%n. %t" -o flac %d/$(basename %f .cue).flac
>
> However, the formatting following the -t option is meant for
> shnsplit, not Thunar! Which means %n gets expanded into the file
> name. I've also tried using just %t, which is not used by Thunar, and
> that also breaks it. Perhaps it gets expanded into nothing.
>
> Is it impossible to give certain programs %-style formatting via
> custom actions? I've tried escaping using "\", to no avail.

You should be escape the "%" via a 2nd "%", thus:

shnsplit -f %f -t "%%n. %%t" -o flac %d/$(basename %f .cue).flac

See source:
https://github.com/xfce-mirror/thunar/blob/a763a7f965b467c5e2dc504493fcbdef9b30209b/plugins/thunar-uca/thunar-uca-model.c#L1667-L1668

Regards, Mathias
_______________________________________________
Thunar-dev mailing list
[hidden email]
https://mail.xfce.org/mailman/listinfo/thunar-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using %-style formatting in Thunar custom actions

fliehen
On Fri, 9 Jun 2017 22:15:26 +0200
Mathias Brodala <[hidden email]> wrote:

> You should be escape the "%" via a 2nd "%"

Ah, excellent! Thank you!
I'll be sure to check out the source code more often when the documentation is lacking. In fact, I think this deserves being added to the wiki page for Thunar actions, or perhaps even to the dialog itself!

--
fliehen <[hidden email]>
_______________________________________________
Thunar-dev mailing list
[hidden email]
https://mail.xfce.org/mailman/listinfo/thunar-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using %-style formatting in Thunar custom actions

Mathias Brodala
Hi,

fliehen schrieb am 09.06.2017 um 23:05:
> On Fri, 9 Jun 2017 22:15:26 +0200 Mathias Brodala <[hidden email]>
> wrote:
>
>> You should be escape the "%" via a 2nd "%"
>
> Ah, excellent! Thank you! I'll be sure to check out the source code
> more often when the documentation is lacking. In fact, I think this
> deserves being added to the wiki page for Thunar actions, or perhaps
> even to the dialog itself!

I totally agree. Unfortunately I cannot find a way to log into
docs.xfce.org to edit the page, so if you can, go ahead. You might also
want to check Bugzilla if you'd like to see this mentioned in the
dialog, too.

Regards, Mathias
_______________________________________________
Thunar-dev mailing list
[hidden email]
https://mail.xfce.org/mailman/listinfo/thunar-dev
Loading...