Xfce Forum

Sub domains
 

You are not logged in.

#1 2015-03-23 01:04:17

pressanykey
Member
From: USA
Registered: 2013-06-16
Posts: 15

[Solved] Thunar 1.6.6 Configure custom actions not working

Manjaro 0.8.12 (Xfce 4.12)

The following script used to work in 4.10

/home/whatever/bin/MediaInfo.sh:
#!/bin/sh

for inpath in $@; do
   mediainfo-gui "${inpath}" &
done

with the Thunar custom action:
/home/whatever/bin/MediaInfo.sh "%F"

It ONLY works in 4.12 if there are NO spaces in the selected filename. In 4.10, the "%F" worked for files that contained spaces.
So, it's not specifically mediainfo-gui - it's that custom actions isn't processing files with spaces correctly.

Also, I'm getting a dangling quote at the end of filenames emitted from the custom action into the sh script. If I switch out mediainfo-gui in the script with smplayer, I see a terminating single quote at the end of the file name in the file list.


Xfce 4.12
Manjaro 0.8.12 (x86_64)

Offline

#2 2015-03-23 01:27:44

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,494

Re: [Solved] Thunar 1.6.6 Configure custom actions not working

Just ran your script here and I see the same problem. A bug report is probably in order.


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

#3 2015-03-23 02:55:58

pressanykey
Member
From: USA
Registered: 2013-06-16
Posts: 15

Re: [Solved] Thunar 1.6.6 Configure custom actions not working


Xfce 4.12
Manjaro 0.8.12 (x86_64)

Offline

#4 2015-03-23 05:50:45

sonycdr
Member
Registered: 2009-01-30
Posts: 130

Re: [Solved] Thunar 1.6.6 Configure custom actions not working

pressanykey wrote:

...
with the Thunar custom action:
/home/whatever/bin/MediaInfo.sh "%F"
...

I don't think it's a bug, just don't quote %F and it will works

examples:

selected files: "file (1).txt" and "file (2).txt"
custom action command: script.sh %F

#!/bin/sh
# It will not work if you quote %F like: script.sh "%F"
# work only if you doesn't quote: script.sh %F
(for inpath in "$@"; do echo 'testcommand #1' "${inpath}"; done)> output.txt
(for inpath in "$@"; do echo 'testcommand #2' ${inpath}; done)>> output.txt
(for inpath in "$@"; do echo 'testcommand #3' $inpath; done)>> output.txt

#the last two wrap the path with quotes
(for inpath in "$@"; do echo 'testcommand #4' "\""$inpath"\""; done)>> output.txt
(for inpath in "$@"; do echo 'testcommand #5' \"$inpath\"; done)>> output.txt

output.txt:

testcommand #1 file (1).txt
testcommand #1 file (2).txt
testcommand #2 file (1).txt
testcommand #2 file (2).txt
testcommand #3 file (1).txt
testcommand #3 file (2).txt
testcommand #4 "file (1).txt"
testcommand #4 "file (2).txt"
testcommand #5 "file (1).txt"
testcommand #5 "file (2).txt"
# One-liner command directly in custom action command field
(for inpath in %F; do echo 'one-liner-custom-action-command' $inpath; done)> output2.txt

Please check if it works without quotes and then edit/comment your bug report.

Last edited by sonycdr (2015-03-23 06:03:28)

Offline

#5 2015-03-23 12:46:55

pressanykey
Member
From: USA
Registered: 2013-06-16
Posts: 15

Re: [Solved] Thunar 1.6.6 Configure custom actions not working

Nope. I did try Configure custom actions without quotes. With or without quotes("%F" or %F), files with spaces in their name doesn't bring happiness from Thunar.

Your test above tests the shell. Please try from within Thunar, configure custom actions.


Xfce 4.12
Manjaro 0.8.12 (x86_64)

Offline

#6 2015-03-23 12:52:46

sonycdr
Member
Registered: 2009-01-30
Posts: 130

Re: [Solved] Thunar 1.6.6 Configure custom actions not working

pressanykey wrote:

Nope. I did try Configure custom actions without quotes. With or without quotes("%F" or %F), files with spaces in their name doesn't bring happiness from Thunar.

Your test above tests the shell. Please try from within Thunar, configure custom actions.

Did you wrapped $@ between quotes? Please look the code I posted, everything I posted is tested.

Offline

#7 2015-03-23 13:37:45

pressanykey
Member
From: USA
Registered: 2013-06-16
Posts: 15

Re: [Solved] Thunar 1.6.6 Configure custom actions not working

Please test with a filename with spaces. Like "a b c.txt". Thunar launches (3) MediInfo windows in my example above.

Please actually try to launch with a custom action when you select a file that contains spaces.

If it works, please post your custom action and the script it calls.


Xfce 4.12
Manjaro 0.8.12 (x86_64)

Offline

#8 2015-03-23 14:02:58

sonycdr
Member
Registered: 2009-01-30
Posts: 130

Re: [Solved] Thunar 1.6.6 Configure custom actions not working

pressanykey wrote:

Please test with a filename with spaces. Like "a b c.txt". Thunar launches (3) MediInfo windows in my example above.

Please actually try to launch with a custom action when you select a file that contains spaces.

If it works, please post your custom action and the script it calls.

You _persist_ do not read and test what I wrote for you? that's fine.

Offline

#9 2015-03-23 14:52:55

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,494

Re: [Solved] Thunar 1.6.6 Configure custom actions not working

@sonycdr is correct. Enclosing $@ in quotes fixes the issue.

@pressanykey, do you recall what version of Thunar you used when using 4.10? I tested on version 1.6.3 and the same applies.


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

#10 2015-03-23 16:03:58

sonycdr
Member
Registered: 2009-01-30
Posts: 130

Re: [Solved] Thunar 1.6.6 Configure custom actions not working

Thank goodness you're here @ToZ because I ended up being discouraged.

Offline

#11 2015-03-23 21:53:21

MountainDewManiac
Member
From: Where Mr. Bankruptcy is Prez
Registered: 2013-03-24
Posts: 1,115

Re: [Solved] Thunar 1.6.6 Configure custom actions not working

sonycdr wrote:

Thank goodness you're here @ToZ because I ended up being discouraged.

No reason to be discouraged, sonycdr. I have gotten the impression (true or not, IDK) that English is not your native language - but your words (and meaning) are always perfectly clear, nonetheless. If you tell someone that it is safe to eat chicken as long as they cook that foul fowl thoroughly, and they later complain because they got salmonellosis (aka "salmonella") because they decided you meant that they should eat it raw, well... That wouldn't be your fault, either wink .

Just keep helping us ignorant sorts as best you can (if you will); someone will be along to translate (or "translate") directly. And thanks for doing so! (Thanks to ToZ, as well. tongue )

Regards,
MDM


Mountain Dew Maniac

How to Ask for Help <=== Click on this link

Offline

#12 2015-03-23 23:40:20

pressanykey
Member
From: USA
Registered: 2013-06-16
Posts: 15

Re: [Solved] Thunar 1.6.6 Configure custom actions not working

@sonycdr - I am so sorry.. NOW I SEE...MY BAD!!!  And, PLEASE keep persisting; especially with sorts like me!!!

I'll get it working and then close the ticket...

Thanks!!!! Again ALL!!


Xfce 4.12
Manjaro 0.8.12 (x86_64)

Offline

#13 2015-03-24 01:35:36

pressanykey
Member
From: USA
Registered: 2013-06-16
Posts: 15

Re: [Solved] Thunar 1.6.6 Configure custom actions not working

Thanks @sonycdr and @ToZ!!!!!!!!!!

And especially sorry I annoyed.
I also closed the Bug.

Works great now!!!

/home/whatever/bin/Backup.sh %F

- with -

#!/bin/sh

datesuffix=`date +'%Y%m%d_%H%M%S'`

for inpath in "$@"; do
   cp -pr "${inpath}" "${inpath}.${datesuffix}"
done


Takes files and directories.


Xfce 4.12
Manjaro 0.8.12 (x86_64)

Offline

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

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.008 seconds, 7 queries executed - Memory usage: 572.29 KiB (Peak: 589.13 KiB) ]