this commit is mostly porting over some recent performance improvements
from `sxiv-rifle`: https://github.com/ranger/ranger/pull/2411
there's one "bug-fix" in this commit. currently a file named "afilejpeg"
would be matched due to the `-iregex` in listimages. this commit changes
that so only extensions would match, so for example "afile.jpeg" would
match but not "afilejpeg".
As for performance, there's a couple things this commit does:
* store the result of listimages into a tmp file instead of calling that
function twice, this is probably the biggest performance improvement.
especially when loading large directories.
* abspath now sets the var abs_target instead of calling printf. since
abspath is only called from load_dir, we can go one step further and
inline it. but i haven't done that since the function might be useful
later on.
* avoid call to dirname and use parameter subsitution instead inside
`listimages`
* use grep instead of `-iregex`, it's POSIX compliant and can be faster.
i've tested this out with sxiv and everything seems to be working as
expected.
Most *.desktop entries have same name as their application name so this
is not an issue most of the time. However in the case of Neovim, the
application name is "Neovim" while the desktop entry is "nvim.desktop"
Since dmenu is case sensitive by default this means that searching
"neovim" will not show any results since the N is not capitalized and
the desktop entry name is "nvim"
fzf doesn't have this issue since its case-insensitive/fuzzy by
default. Making dmenu case-insensitive solves this.
Also fix the indentation to be consistent with the rest of the script.
* xdgdefault plugin: add dmenu support
use fzf if available. otherwise, if available, use dmenu.
should be possible to use rofi as well, but i don't use rofi nor do i
have it installed for testing.
* xdgdefault plugin: add GUI flag
* update xdgdefault requirement