bemenu icon indicating copy to clipboard operation
bemenu copied to clipboard

bemenu-run shows non-executable files in $PATH.

Open crocket opened this issue 3 years ago • 10 comments

Linux distribution packages install non-executable files in $PATH.

crocket avatar Sep 15 '20 08:09 crocket

$PATH ideally should only contain executables, that's the purpose of it. Doing additional check whether file is executable or not could potentially make bemenu-run much slower as it would need stat system call for every file!

Cloudef avatar Sep 15 '20 10:09 Cloudef

dmenu-run creates a cache through dmenu_path.

crocket avatar Sep 15 '20 11:09 crocket

Yeah, you can optionally do that yourself as well. The bemenu-run is designed to read PATH as is and rely on linux's filesystem cache. So it's usually fast without any own caching.

Cloudef avatar Sep 15 '20 12:09 Cloudef

For now, I pipe the output of dmenu_path to bemenu.

crocket avatar Sep 18 '20 10:09 crocket

I could perhaps also introduce option for bemenu-run that filters the PATH.

Cloudef avatar Sep 21 '20 11:09 Cloudef

What about caching?

crocket avatar Sep 23 '20 00:09 crocket

If you want external cache, then using something like dmenu_path or rolling your own is recommended as it's also simpler than implementing it in bemenu-run, doing that you could even supply bemenu the shell's own cache. bemenu-run is simple program that only relies on the filesystem cache, doesn't write anything to the disk nor doesn't have to worry when to invalidate the cache.

Cloudef avatar Sep 23 '20 06:09 Cloudef

Is bemenu-run going to be reasonably fast if it checks execution permission?

crocket avatar Sep 23 '20 06:09 crocket

That I don't know without testing. I'd assume filesystem cache also caches metadata so my guess would be yeah.

Cloudef avatar Sep 23 '20 06:09 Cloudef

It will be fast on a hot cache but can be extremely slow when it's cold depending on the filesystem and medium

Earnestly avatar Sep 23 '20 13:09 Earnestly