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.35k stars 39 forks source link

Floating window #306

Open JE-Amouel opened 2 months ago

JE-Amouel commented 2 months ago

Hi, I do love navigation's phylosophy of clifm,however I wonder if we would have feature such as floating window.

Thanks, I love your job.

leo-arch commented 2 months ago

Hi @JE-Amouel, and thanks.

What do you mean exactly by floating window? Clifm is not involved at all with windows: it runs on a terminal which sometimes runs on a window. Be it as it may, window stuff is done by the window manager.

Maybe you're talking about panes, like the TUI ones, say Midnight Commander. Maybe related to https://github.com/leo-arch/clifm/issues/303.

JE-Amouel commented 2 months ago

I wanted to talk about floating pane. Here is a quick preview

tutorial-1-using-floating-panes

JE-Amouel commented 2 months ago

I also have some educational questions, Which library do you use? There is a thing that I don't understand very well, I use wezterm which has image support, and whatever the command I use to view an image within clifm, it works very well, my question is,... HOW? Is cilfm adds its own implementation to handle images?

leo-arch commented 2 months ago

I wanted to talk about floating pane. Here is a quick preview

Thanks for the clarification @JE-Amouel. Yes, this is a TUI pane. But clifm's main interface isn't TUI, but CLI. Fo better or worse, this is a design decision. I'll keep this in mind however.

leo-arch commented 2 months ago

whatever the command I use to view an image within clifm, it works very well, my question is,... HOW?

Clifm has no internal protocol to handle images (file previews, more generally), but relies on external applications. However, it can decide which is the more appropriate application (based on file type or file name) pretty well via configuration files (much like Ranger does with its scope.sh script).

When it comes to opening files, it consults mimelist.clifm (which you can edit/view via the mm edit command) to decide which is the more appropriate opening application. For more info take a look at the resource opener page.

Now, when it comes to file previews (e.g., when you run the view command, or when you run clifm --preview FILE), the procedure is similar: it first consults preview.clifm (which you can edit/view via the view edit command) to decide which is the more appropriate previewing application. For more information take a look at the file previews page.

If you're talking about file previews with FZF (TAB completion). This is how it works:

  1. Fzf is invoked with the appropriate parameters to generate the completion list.
  2. Clifm tells fzf to generate file previews via clifm itself (i.e. via clifm --preview FILE).

You can play around with clifm --preview to get an idea of how file previews are generated for clifm's TAB completion.

JE-Amouel commented 2 months ago

thanks :pray:

leo-arch commented 2 months ago

You're welcome @JE-Amouel!

JE-Amouel commented 2 months ago

one more thing, how did you manage to make fzf display it ui where you what, for tab completion?

leo-arch commented 2 months ago

how did you manage to make fzf display it ui where you what, for tab completion?

Just passing to fzf the appropriate parameters. Take a look at our code to get an idea of what we're doing. We basically use the --margin option to place the fzf window wherever we want.

JE-Amouel commented 2 months ago

Did you heard about Lash#Cat9?. Do you think, clifm might mimic some of the feature from Lash@cat9

leo-arch commented 2 months ago

Hi @JE-Amouel. No, didn't know about this. I'll definitely take a look at it. Thanks for the reference.

JE-Amouel commented 2 months ago

Hi @leo-arch, did you get time enough to check on that?

leo-arch commented 2 months ago

Only superficially, but it's interesting. Maybe I can grab some idea from this project. I'll keep it in mind.

JE-Amouel commented 2 months ago

Did you heard about Lash#Cat9?. Do you think, clifm might mimic some of the feature from Lash@cat9

I like your project and i love using as it is, forget about that. i am happy with all enhancement you provide trough clifm, i would like to see other program mimic yours. :100: :+1:

thank you for this wonderfull work, which make the live in terminale more productive and friendly :pray:

leo-arch commented 2 months ago

Thank you for your kind words @JE-Amouel! Feedback is always appreciated.