leo-arch / clifm

The shell-like, command line terminal file manager: simple, fast, extensible, and lightweight as hell.
https://github.com/leo-arch/clifm/wiki
GNU General Public License v2.0
1.33k stars 40 forks source link

Assign ELNs to the output of commands #281

Open LinArcX opened 6 months ago

LinArcX commented 6 months ago

Is your feature request related to a problem? Please describe. I don't know if this featue exists or not. Imagin i'm using fd to search for all the *.mp3 files in my PWD and it's child directory like this: fd -e mp3 -d2

The output can be like this:

foo.mp3
bar.mp3
Downloads/zoo.mp3
Downloads/kar.mp3
Downloads/dar.mp3
Downloads/nar.mp3

As you can see, there's no ELN assigned to each row in this output. so if i need to play the musics, i need to type my music player + name of the file, which is time consuming.

Describe the solution you'd like I suggest we should have a mechanism to assign ELN to any stdout output.(generated by any command) in this way, we can benefit from all the things that we can do with ELN.

leo-arch commented 6 months ago

As you can see, there's no EIN assigned to each row in this output.

You can search for files using clifm's internal search function (a slash followed by the query string), for example:

$ /*.mp3

If you want recursivity, you can use the -x parameter, as follows:

$ /*.mp3 -x

However, since ELN's are used only for currently listed file names (and thereby only for files in the current directory), only the first procedure provides ELN's, not the second one.

Of course, you can use external tools (like fd), but they do not know anything about ELN's.

I guess it wouldn't be that hard to write a plugin for this specific use case.

LinArcX commented 6 months ago

If you want recursivity, you can use the -x parameter, as follows..

Can I specify which directories I want to use with this parameter? I ask this because it will take a while if I want to do it in my ~. I prefer to do it just for example for: ~/Downloads, and ~/Musics

However, since ELNs are used only for currently listed file names (and thereby only for files in the current directory), ...

That's the point of my request. We can extend this functionality to not just focus on currently listed file names in the current directory, but instead on any listed files regardless of whether they are in the current directory or not.

leo-arch commented 6 months ago

Hi @LinArcX.

Can I specify which directories I want to use with this parameter?

Yes, but only one, and there will be no ELNs either in the output.

We can extend this functionality to not just focus on currently listed file names in the current directory, but instead on any listed files regardless of whether they are in the current directory or not.

Maybe, but it wouldn't be a trivial implementation at code level. I think a plugin can do this quite easily. Take a look for example at the finder plugin. A few modifications here a there can do the job.