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

Option to have a list of programs in the clifmrc #116

Closed DNDEBUG closed 2 years ago

DNDEBUG commented 2 years ago

add an option on clifmrc to list what programs clifm can run instead of having to read everythign from $PATH this would also help to prevent mistakes or wasting time with tab

also an option to make the name of the binaries explicit so the user will have to explicitly tipe the name of the binary to be able to run it

and clifm causes some mistakes with options from other programs i noticed it with wget and aria2c so it would be good to only accept the programs options after the name of the program and if the user wnats to use something from clifm he will have to specify lets say i want to do somethign with the file 20

program option option $20 i don't know how you could do that and i don't think using $ is a good idea maybe $ELN20

so the moment i tipe the program name clifm stops listening unless i set some flag to use clifm options

leo-arch commented 2 years ago

Hi @DNDEBUG. Sometimes conflicts with external command might arise, true. But CliFM already provides some mechanisms to avoid them:

  1. Disable/enable external commands via the ext command

  2. Prevent all CliFM expansions (sel keyword, ELN's, etc) by prepending ; to your command. Example:

    ;chmod 600 sel 

    In this case, neither 600nor sel will be expanded; the command is sent as is to the system shell

  3. Use a backslash to explicitly avoid ELN expansions:

    chmod \600 file

NOTE: Bear in mind that numbers will only be expanded provided there's such ELN in the current files list. For example, 600 won't be expanded if there are less than 600 files in files list.

DNDEBUG commented 2 years ago

ight very cool

leo-arch commented 2 years ago

So, can we close this issue?

DNDEBUG commented 2 years ago

wait, one more thing is it possible to specify a type of file for each directory? for cue sheets for songs i want to open using mpv but cue sheets for ps1 games i want to open with mednafen so is is possible to specify that any cue inside ~/Games/* should be opened by mednafen?

leo-arch commented 2 years ago

That can be made per file name/MIME type, though not per directories. Just edit the mime file to your liking (mm edit). You'll find details and examples in the file itself.

leo-arch commented 2 years ago

Take a look at the documentation too.

DNDEBUG commented 2 years ago

also, does sending a file to the trash copies the file then deletes the original or moves the file and renames it? because i tried to send to the trash 2 big files and my system got unusable for some seconds i think clifm tried to copy the 2 files to thr trash at the same time

leo-arch commented 2 years ago

Don't remember right now. I'll take a look at it as soon as I'm back home.

leo-arch commented 2 years ago

You were right. I was using the cp/rm approach to trash files. Switched to a single mv command.

DNDEBUG commented 2 years ago

:sunglasses: nice, 3 problems found so far i am trying to use clifm as my default file manager, havent found much motive to use pcmanfm again won't remove it yet unless i find a way to open clifm as default for example on transmission if i doucle click on a folder, it will open pcmanfm in the folder i clicked i don't know if its possible to do the same with clifm

DNDEBUG commented 2 years ago

i also want to ask for a feature something like a temporary bookmark the user can create a bookmark that will only exist in one session will not interfere with other session and when the session is closed the bookmar disappears

leo-arch commented 2 years ago

Of course it is. There's a desktop file for that that should be installed upon clifm installation. If you were just compiling from source, you only need to place the corresponding desktop file in XDG_DATA_DIRS/applications (usually, /usr/share/applications or /usr/local/share/applications).

leo-arch commented 2 years ago

As to temporary bookmarks, there is no such thing in CliFM, but it do provides profiles and pinned dirs. Finally, you can also make use of the stealth mode for a single session: it will start with default values, nothing will be read from nor written to disk, so bookmarks created in a stealth session will only last for that single session.

DNDEBUG commented 2 years ago

seems like it does work, but it is opening clifm in the background

DNDEBUG commented 2 years ago

tried Exec=$TERM clifm, didn't work Exec=foot -e clifm did work

leo-arch commented 2 years ago

Nice to hear it works. But it should work out of the box. The Terminal=true field is supposed to instruct the launching application to run the command specified in Exec in a new terminal window. For exampĺe, if I run Thunar and click on Open with CliFM in the Open with menu, CliFM is launched on lxterminal (which I guess is the first terminal Thunar found available).

DNDEBUG commented 2 years ago

weirdly it didn't work, i don't know why my $TERM is correct, it should be used might be a problem with xdg

leo-arch commented 2 years ago

Or maybe some wayland related stuff (still on the old X11 here).

DNDEBUG commented 2 years ago

ah yeah, :disappointed: i left x11 wayland has become goodenough already might be something related

leo-arch commented 2 years ago

Thank you very much for reporting these issues @DNDEBUG! If everything's fine now, please close this issue.

DNDEBUG commented 2 years ago

one last question are you making sure to clean the code? i saw that the binary was slowly growing and growing and at one point the size went down dramatically and i haven't changed the build options

leo-arch commented 2 years ago

I've been doing no big code changes lately, but mostly fixing bugs and little improvements here and there. The binary size is currently around 700Kb, depending on your compilation flags. Though it is always possible to shrink the code down, to make it faster and smaller, I really try to keep the code clean, secure, and performant.

So, I'm not sure what the cause of that size decrement could be. But in any case, better down than up, isn't it?

DNDEBUG commented 2 years ago

i was just worried that you might forget some feature, function or code you don't need anymore and it is just there doing nothing

leo-arch commented 2 years ago

Well, that's always a possibility that, however, I try to firmly avoid.

DNDEBUG commented 2 years ago

nothing to ask for now, i'll close it and report if i find any other problem