"Open With" Context Menu - Bash Commands
Posted: Wed Feb 09, 2022 3:57 am
I frequently use the following interactive grep command:
As an alternative, it would be handy to have it as a desktop file that could be called from the context menu ("Open with") in pcmanfm. Is this possible?
I've tried without success entering the Exec= field in the following ways:
- Entered the straight command line without any modifications
- Prepended the command line with bash
- Prepended the line with bash -c
- Prepended the line with lxterminal
- Prepended the line with lxterminal bash
- Added %f
- Added %F
- Made the line into a simple script and placed the script filename into the Exec= field (with and without bash, bash -e, etc.)
Any ideas?
I'd prefer to not go the script route if at all possible. I've played with simple scripts in the past but keep forgetting their ins and outs and end up going back to plain desktop files.
Code: Select all
echo "Enter keyword" && read keyword && grep -i --color=always $keyword /pathtofilename
I've tried without success entering the Exec= field in the following ways:
- Entered the straight command line without any modifications
- Prepended the command line with bash
- Prepended the line with bash -c
- Prepended the line with lxterminal
- Prepended the line with lxterminal bash
- Added %f
- Added %F
- Made the line into a simple script and placed the script filename into the Exec= field (with and without bash, bash -e, etc.)
Any ideas?
I'd prefer to not go the script route if at all possible. I've played with simple scripts in the past but keep forgetting their ins and outs and end up going back to plain desktop files.