Bug 388321 - Own scripts refuse to start via contex menu
Summary: Own scripts refuse to start via contex menu
Status: RESOLVED WORKSFORME
Alias: None
Product: krusader
Classification: Applications
Component: general (show other bugs)
Version: Git
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Krusader Bugs Distribution List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-29 12:42 UTC by bbutscheidt
Modified: 2018-05-06 00:16 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description bbutscheidt 2017-12-29 12:42:02 UTC
Here is what I do:

1. right click on a video file
2. choose my script mpv.sh to open the file
3. Krusader reports: 
"Could not start /home/bernd_b/mpv.sh /mnt/sda9/ProjectX/TV/dst/name_of_video_file.mkv"

It worked for years, now out of the sudden, it stopped working. No problem doing the same with dolphin (same entries in the context menu) or thunar (same script referred to). Of course, a simple

/home/bernd_b/mpv.sh /mnt/sda9/ProjectX/TV/dst/name_of_video_file.mkv

works as well. I copied the line out of the error message of krusader into a terminal (which could be considered as a work around so far).

2.6.1.beta.r5758.gbd852a2f-1 and 2.6.0 from the archlinux repository behave equally.
Comment 1 bbutscheidt 2018-01-31 21:43:42 UTC
So I don't know why and when krusader became that sort of selective of which scripts to run or not - but:

If I add 
[code]#!/bin/bash[/code]
at the start of my scripts, krusader seems to run them again via context menu or via doubleclick. I was mislead by the fact that in earlier times this was not necessary and that other file managers like dolphin aren't this picky.
Comment 2 Nikita Melnichenko 2018-02-11 05:46:37 UTC
Can you share the script or a simplified version of the script? I can try to repro on my side.
Comment 3 Nikita Melnichenko 2018-02-15 05:18:54 UTC
I created the most simple mpv.sh containing "mpv $1" and it works as expected on my side. Let us know if you'd like to provide your script or you're satisfied with adding "#!/bin/bash" which is recommended to do anyways.
Comment 4 bbutscheidt 2018-02-18 18:25:33 UTC
(In reply to Nikita Melnichenko from comment #3)
> I created the most simple mpv.sh containing "mpv $1" and it works as
> expected on my side. Let us know if you'd like to provide your script or
> you're satisfied with adding "#!/bin/bash" which is recommended to do
> anyways.

Sorry for taking so long to answer. 
Since I am alone here, I consider the strange behaviour to be caused by my setup.
Anyway, it is as simple as you tried:

Non working:
====================

options="--autofit=75% --hwdec=vdpau --hwdec-codecs=all --vo=vdpau --vf-defaults=vdpaupp:deint=yes:deint-mode=bob"


kommando="mpv "$options" "\"$1\"
kommando="xfce4-terminal --command="\'$kommando\'

#echo
echo $kommando

eval $kommando
========================

Marking a video file, right mouse menu and selecting the script to open it with the selected one I get again:
"Could not start /home/bernd_b/mpv.sh /mnt/int4TB_02/...mkv"

But adding #!/bin/bash

========================
#!/bin/bash


options="--autofit=75% --hwdec=vdpau --hwdec-codecs=all --vo=vdpau --vf-defaults=vdpaupp:deint=yes:deint-mode=bob"


kommando="mpv "$options" "\"$1\"
kommando="xfce4-terminal --command="\'$kommando\'

#echo
echo $kommando

eval $kommando

================================

and everything is fine. I can live very well with this solution -  it only took me some time to find it since I never needed to be this correctly for a long time up to these days.
Comment 5 Christoph Feck 2018-03-01 02:43:17 UTC
Nikita, does comment #4 provide the requested information? Please set the bug status or add a comment.
Comment 6 Nikita Melnichenko 2018-03-02 06:13:27 UTC
I tried to repro using the reporter's script (only replacing xfce4-terminal with konsole) - still it could be run on my side without issues.

From comment #4, the reporter seems to be satisfied with adjusting the scripts. I'm closing the issue and will track if someone reports the same.