With the latest version of "lfrc", some file types cause problems.
For example, some text files that should be opened with an editor, are opened with "Libreoffice Writer". Morever spreadsheet files can't even be opened while "xdg-open" or similar commands can open those files with correct applications.
Normally, we set our environment by mime-types. Why do we specify programs in "lfrc" by increasing the complexity, instead of using a minimal configuration file that can open files with default set applications?
I understand the use case of "sxiv" with rotdir script. We also want to open some applications (scripts) as texts rather than running them. But for others I find the extra configuration, unnecessary and complex.
I won't open a PR for this since I am not sure about the specific use case. Maybe Luke has some specific use case or explanation for the extra lines.
I use this minimized function with the exact same functionality (for my use case):
cmd open ${{
case $(file --mime-type "$(readlink -f $f)" -b) in
text/*|application/json|inode/x-empty|application/x-subrip) $EDITOR $fx;;
image/*) rotdir $f | grep -i "\.\(png\|jpg\|jpeg\|gif\|webp\|avif\|tif\|ico\)\(_large\)*$" |
setsid -f sxiv -aio 2>/dev/null | while read -r file; do
[ -z "$file" ] && continue
lf -remote "send select \"$file\""
lf -remote "send toggle"
done &
;;
*) for f in $fx; do setsid -f $OPENER $f >/dev/null 2>&1; done;;
esac
}}
With the latest version of "lfrc", some file types cause problems.
For example, some text files that should be opened with an editor, are opened with "Libreoffice Writer". Morever spreadsheet files can't even be opened while "xdg-open" or similar commands can open those files with correct applications.
Normally, we set our environment by mime-types. Why do we specify programs in "lfrc" by increasing the complexity, instead of using a minimal configuration file that can open files with default set applications?
I understand the use case of "sxiv" with rotdir script. We also want to open some applications (scripts) as texts rather than running them. But for others I find the extra configuration, unnecessary and complex.
I won't open a PR for this since I am not sure about the specific use case. Maybe Luke has some specific use case or explanation for the extra lines.
I use this minimized function with the exact same functionality (for my use case):
Rather than this huge block: