xdg-open ignore gio in some DEs
For example
open_lxqt()
{
open_generic "$1"
}
However, I hope I can use gio open
like
open_lxqt()
{
if gio help open 2>/dev/null 1>&2; then
gio open "$1"
else
open_generic "$1"
fi
}
Because open_generic
will hang in terminal, such as for pdf, it will call zathura a.pdf
. But gio open
will not.
Can I do it without changing the code of xdg-open?
Why xdg-open must check DE then decide use which program? Why not check if some program exist, then use this program to open file?
Thanks!