Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed, locked pane for the file list #303

Closed
pcause opened this issue Aug 26, 2024 · 7 comments
Closed

fixed, locked pane for the file list #303

pcause opened this issue Aug 26, 2024 · 7 comments

Comments

@pcause
Copy link

pcause commented Aug 26, 2024

Is your feature request related to a problem? Please describe.

I like the approach and philosophy, but i'd like to be able to specific a size (lines) for the file display and lock that display at the top of the terminal/pane.

Describe the solution you'd like

If you could check for TMUX and create a pane above the pane the app is running in (split horizontal the current pane) and use that pane for the file list display. You could perhaps create a thread to handle the display for that pane. We'd still have a cli file manager but the pane window can show the files and keep them locked above the commands and perhaps the pager in that pane would allow the long lists to be scrolled. sort of a poor mans tui keeping the essence of the philosophy of the app.

Describe alternatives you've considered
I think other alternatives would lose the spirit of being a cli driven file manager.

@leo-arch
Copy link
Owner

Hi @pcause, and thanks for sharing your ideas.

What you describe is an alternative interface for clifm without losing its spirit, true. Maybe better, maybe not, it depends. However it may be, this alternative panes-based interface would imply:

  1. A complete rewrite of the current interface (which is a lot of work)
  2. The usage of the curses library to manage it (which we currently don't use at all).

Summing up, yours is a good idea (like clifm 2.0 or something along these lines), but currently far from our aims. I'll keep this idea in mind however: I like it.

Thanks again.

@pcause
Copy link
Author

pcause commented Aug 27, 2024

If I use the following, I can get the kind of behavior I want:

clear; ls ; more -c --lines 10

but i can't figure out how to get this in clifm. if I copy the pager plugin to profile/default/plugins and hack it up will it work or is there something else I am missing.

@leo-arch
Copy link
Owner

clear; ls ; more -c --lines 10

If you want this as a plugin:

  1. Write the script (say, ~/.config/clifm/plugins/pager2.sh):
#!/bin/sh

clear; ls | more -c --lines 10

exit 0

Hook it up to actions (via actions edit):

pager=pager2.sh

@pcause
Copy link
Author

pcause commented Aug 28, 2024

tried this but it still seems to run the built in pager. i assume that is the pager.sh found in /usr/share/clifm? The gg command will use pager2 but then it paints the file list with the build in pager.

Should I replace the pager.sh script in /usr/share? Question: is the pager built in code rather than the script?

@leo-arch
Copy link
Owner

An action has two fields: 1) the invocation name, and 2) the plugin to be executed. In the above example, pager is the invocation name, and pager2.sh is the command. So, you need to invoke the plugin with the invocation name (pager).

At this point you have three pagers: the builtin pager (invoked via pg or Alt-0), the gg plugin (invoked via gg), and your custom pager (invoked via pager).

Should I replace the pager.sh script in /usr/share?

No. Everything is done in ~/.config/clifm/plugins. (Clifm first inspects this directory, and if the plugin isn't found here, it will check /usr/share/clifm/plugins as well).

@pcause
Copy link
Author

pcause commented Aug 28, 2024

Thanks. So I take it from the answer that the built-in page will always run to refresh the file list. I can use gg or pager action to get my script to run. But it seems there isn't a way to override / modify the behavior of the built in pager. Thansk and I'll close this.

@pcause pcause closed this as completed Aug 28, 2024
@leo-arch
Copy link
Owner

leo-arch commented Aug 28, 2024

Yes, the builtin pager do can be overridden. Name your plugin pg instead of pager and the pg command will run your pager instead of the builtin one.

If you want to override the Alt-0 keybinding follow these steps:

  1. Name your plugin plugin2 (via actions edit).
  2. Run kb edit and bind plugin2 to Alt-0 (you need to remove/comment the existing keybinding first):
#run-pager:\M-0
plugin2:\M-0
  1. Restart clifm

For more info take a look at the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
@pcause @leo-arch and others