marvinkreis/rofi-file-browser-extended

Standard input with pipes (or exceptions + multiple dirs)

RaitaroH opened this issue · 2 comments

So let me explain.

This rofi extension is quite awesome and I like it for the icons. I am using a script right now that works like so:

  • use fd with a LOT of exclusions so it only shows what I want (speeds up the search by a lot)
  • pipe the fd output into rofi
  • if something was chosen then open it with xdg-open

As you can see, using fd and excluding stuff like .cache, .firefox, .local, wine, tmp Games, Github etc, just makes the search so fast I can start typing the second I run the script. This rofi extension you have is also quite fast but because it has to display everything it just takes a lot longer.

My suggestion then would be as such:

  • allow some sort of excluding option like fd and find have, or something of the sorts;
  • allow multiple dirs to be searched. Right now only one folder can be as far as I can tell.

Or, even better:

  • allow the output from find (or in this case fd) to be simply the input for rofi-file-manager.

Just so you know I did try to play around with using file to get the mime-type of the files, then use sed to replace that with markup for rofi, then add to that the file names themselves, then pipe that into rofi (works great for my music script btw).The problem is that where fd takes less than half a second to actually perform the search.... to get the file types takes minutes.

Hmm, that's a bit of a tough one.

I don't really like the idea of "allowing multiple directories to be searched" since this is not how file browsers usually work. I'd like to keep a single "current directory" still.

I'm fine with some sort of "one shot" mode that takes paths from stdin, since it makes a lot of sense for scripting. File exclusions also seem like a good idea. I'll see what works best.

For now, you may be able to work around this issue by creating a single directory with symlinks to all the directories you want to list in rofi, and then opening that.

I implemented reading file from stdin with -file-browser-stdin and filename exclusions with -file-browser-exclude.