Xfce Forum

Sub domains
 

You are not logged in.

#1 2025-08-16 09:37:39

Mirassaqua
Member
Registered: 2020-02-02
Posts: 6
UbuntuFirefox 141.0

Thunar Custom Actions – File pattern with reg. exp. for appear conds

Hello.

I want to create a Custom Action in Thunar that is only available for a file ending with a T followed by 2 arbitrary numbers (examples: abcT01, xh24gsdtT76…).
I unsuccessfully tried to introduce the file pattern T[0-9][0-9]$ (or T[0-9][0-9], T[0-9]{2}$, T[0-9]{2}) in the Appearing Conditions window.

Is it possible, and does anyone have an idea of how to proceed?
Thank for your help.

Aqua

Offline

#2 2025-08-16 11:29:00

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 12,123
LinuxFirefox 141.0

Re: Thunar Custom Actions – File pattern with reg. exp. for appear conds

I don't believe thunar custom actions supports regex in the Appearance Conditions - its just simple file extensions it supports. You'll have to move the logic into the script that is run when the custom action is executed - checking for the pattern in the script. Something like:

if echo "$1" | grep -qE 'T[0-9][0-9]'; then
   ### do something to the file
fi

Unfortunately, this custom action will appear on all files that meet the appearance (extension) pattern.


Mark solved threads as [SOLVED] to make it easier for others to find solutions.
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2025-08-21 14:54:52

Mirassaqua
Member
Registered: 2020-02-02
Posts: 6
UbuntuFirefox 141.0

Re: Thunar Custom Actions – File pattern with reg. exp. for appear conds

Hello Toz.
Thank you very much for taking the time to review and respond to my request.
I followed your advice, and everything is working well for checking the pattern of the input file afterwards.
Aqua

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.012 seconds, 7 queries executed - Memory usage: 541.45 KiB (Peak: 551.17 KiB) ]