I tried various ways but couldn't achieve it.
There are appimages or scripts I use which have chmod+x.
My goal is this, prompt_open() shell check if file is executable.
If it is, it will run. Else, xdg-open will open it. But no success so far.
Do you have any idea how to do it? Or is it even possible?
prompt_open() {
if [ -x "$target" ]; then
cmd() { $target; };
else
if [ -x "$(command -v sesame)" ]; then cmd() { xargs sesame; }
else cmd() { xargs xdg-open; }; fi
fi
prompt_base "$@"
}
I tried various ways but couldn't achieve it.
There are appimages or scripts I use which have chmod+x.
My goal is this, prompt_open() shell check if file is executable.
If it is, it will run. Else, xdg-open will open it. But no success so far.
Do you have any idea how to do it? Or is it even possible?