Xfce Forum

Sub domains
 

You are not logged in.

#1 2024-11-02 20:57:23

Sabudum
Member
Registered: 2024-11-02
Posts: 3
LinuxChrome 129.0

Need some help with Thunar custom action

I'm trying to automate the conversion of bin/cue files to chd.

I'm using the command:
terminology -e "chdman createcd -i \"%f\" -o \"`echo "%f" | sed 's/\.[^.]*$//'`.chd\""

Which works absolutely fine when ran from a terminal, but it doesn't work when called as a Thunar custom action.

What I'm trying to do is just take the input filename, remove the extension and add a .chd extension, works fine when running from a terminal or script.

When running it from a terminal I simply replace the %f with the actual filename though.
And with a script, I replace %f with $1 so I can input the filename.


Many thanks in advance.

Last edited by Sabudum (2024-11-02 21:00:46)

Offline

#2 2024-11-02 22:41:07

peter.48
Member
From: France, sud-ouest
Registered: 2017-01-31
Posts: 157
LinuxFirefox 107.0

Re: Need some help with Thunar custom action

And what have you marked in the second tab ("conditions of appearance")?

Offline

#3 2024-11-03 13:18:53

Sabudum
Member
Registered: 2024-11-02
Posts: 3
LinuxChrome 129.0

Re: Need some help with Thunar custom action

peter.48 wrote:

And what have you marked in the second tab ("conditions of appearance")?

I'm sorry but, seriously? I might be slow and fairly new to Linux, but I'm not THAT dumb.

2gIQ1RC.png
anffGRL.png


The problem I'm having is that when I click my custom action, the terminal flashes for a few miliseconds, and nothing happens.

I've created other custom actions with the terminal that work fine, such as:
terminology -e "bin2ecm %F"

And in fact if I write the following:
terminology -e "chdman createcd -i \"%f\" -o \"%f.chd\""
It works but I don't get the nice extensions manipulation, like, if the Input is Driver.cue, then the output becomes Driver.cue.chd, where what I need is Driver.chd

Which by the way, begs to differ, a nice addition to Thunar would be adding a variable that holds the filename without the extension.

Last edited by Sabudum (2024-11-03 13:19:49)

Offline

#4 2024-11-03 13:53:06

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,508
LinuxFirefox 132.0

Re: Need some help with Thunar custom action

The problem I'm having is that when I click my custom action, the terminal flashes for a few miliseconds, and nothing happens.

If your distro logs to ~/.xsession-errors, have a look there for the error message.

It might be that some of the special characters aren't being processed properly. Try creating a script that does the work and pass %f into the script (which would become $1).

Edit: What version of Xfce and thunar are you using?

Edit2: Does the same problem exist if you use xfce4-terminal as the terminal client?

Last edited by ToZ (2024-11-03 13:55:35)


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#5 2024-11-03 14:14:01

peter.48
Member
From: France, sud-ouest
Registered: 2017-01-31
Posts: 157
LinuxFirefox 107.0

Re: Need some help with Thunar custom action

I'm sorry but, seriously? I might be slow and fairly new to Linux, but I'm not THAT dumb.

I don't know your knowledge but I have seen many things even stronger. I myself like anyone else have started at the time without knowing absolutely nothing and I still can't say that I know a lot...
But you are new here which makes me think that maybe you are also new to Linux, without any bad ideas.
I can see by your emotional reaction that I have touched your ego, I am sorry, it was not my intention.

Offline

#6 2024-11-03 14:37:34

Sabudum
Member
Registered: 2024-11-02
Posts: 3
LinuxChrome 129.0

Re: Need some help with Thunar custom action

ToZ wrote:

The problem I'm having is that when I click my custom action, the terminal flashes for a few miliseconds, and nothing happens.

If your distro logs to ~/.xsession-errors, have a look there for the error message.

It might be that some of the special characters aren't being processed properly. Try creating a script that does the work and pass %f into the script (which would become $1).

Edit: What version of Xfce and thunar are you using?

Edit2: Does the same problem exist if you use xfce4-terminal as the terminal client?


My system does log to xsession-errors, but there are no errors there!? Funny thing... (related to thunar or chdman or anything that would suggest it)

I already tried creating the script and calling the script from the thunar action, and passing %f as the parameter, but the same problem persists, whilst calling the script from a terminal works fine.

I'm using Thunar 4.18.8, not using XFCE itself though, I'm using Moksha Desktop, so I don't really have the xfce4-terminal installed, should I install it and try it?

EDIT: I believe it's a chdman error, not really a syntax error though, as I can briefly see the error as the terminal flashes on the screen, tried using the --hold keyword but then the terminal stays empty and doesn't show anything.

EDIT 2: Just installed xfce4-terminal and it shows the error when using the --hold keyword:

chdman - MAME Compressed Hunks of Data (CHD) manager 0.270 (unknown)
Error parsing input file ('/media/thales/Data/Games/Emulation/Sony Playstation/roms/Driver.cue': No such file or directory)

Fatal error occurred: 1

File not found, although it exists.

The wierdest thing is that the error doesn't happen if the same command is called from a different environment other than the Thunar custom action

EDIT 3: Found the culprit, single quotes were being escaped into the file path, I removed my double quotes from the command, and it worked.
Thanks a lot for tHe help, wouldn't have done it without ya.

Last edited by Sabudum (2024-11-03 15:32:06)

Offline

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

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.009 seconds, 8 queries executed - Memory usage: 547.72 KiB (Peak: 548.56 KiB) ]