drooly wrote: ↑Wed Feb 16, 2022 5:29 pm
Did you ever read the links I provided to you in my first reply?
Yes. I read it when you first posted it, and unless I missed something, there were no examples using a bash command line as the Exec. It seems to be mainly about using desktop files for GUI programs like file managers, text editors.
Probably an easier way of getting at this is to drop the requirement for a desktop file and just figure out what to put in pcmanfm's Custom Command Line. This is really the heart of the issue and once I understand it, I can build a desktop file around it. So here's a simple exercise:
1. Open pcmanfm
2. Select a file and right click Open With
3. Select Open With at the bottom of the context menu
4. Select Custom Command Line
5. Enter some Bash code.
6. Check the box to have it Execute in Terminal Emulator
In this test I selected my .bashrc file (since it was handy) and for my code I typed
since I knew the word alias was in the .bashrc file a number of times and grep should pick it up. Nothing happened.
So, what am I supposed to add to make this work? That's the heart of the issue.
As I also said, I think you should put that oneliner into a separate shell script, when %f %F %d etc. are passed as positional parameters.
The positional parameter I used in the code in my first post was the dollar sign. I eliminated that for this latest test and instead added a % sign (though it serves a different purpose). I didn't read your last article word by word but did a search for a % sign and didn't see one. I've never seen a % sign in Bash so I'm not sure if we're mixing apples and oranges.
At any rate, I think you're saying now I should write a script. If that's the only way I can do it, I'll take a pass. I don't use scripting often enough to remember all the rules. Whereas I frequently create desktop files with simple commands written into the Exec line. That's what I was hoping I could use.
Again, this was nothing urgent or earth-shattering. I just wanted to build on the rudimentary skills that I already had which is creating desktop files and using Bash on a command line. Scripting is a little more complicated and it has its own set of rules which, when I used to try doing it, I could never remember.