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

Floating window #306

Open JE-Amouel opened 1 week ago

JE-Amouel commented 1 week 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 1 week 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 9 hours ago

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

tutorial-1-using-floating-panes

JE-Amouel commented 9 hours 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 9 hours 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 8 hours 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 8 hours ago

thanks :pray:

leo-arch commented 8 hours ago

You're welcome @JE-Amouel!

JE-Amouel commented 8 hours ago

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

leo-arch commented 8 hours 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.