You are not logged in.
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
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
Xfce 4.12
Manjaro 0.8.12 (x86_64)
Offline
...
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
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
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
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
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
@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
Thank goodness you're here @ToZ because I ended up being discouraged.
Offline
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 .
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. )
Regards,
MDM
Offline
@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
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
[ Generated in 0.008 seconds, 7 queries executed - Memory usage: 572.29 KiB (Peak: 589.13 KiB) ]