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

Can't open multiple files in selection #187

Open
Iduoad opened this issue Feb 4, 2023 · 10 comments
Open

Can't open multiple files in selection #187

Iduoad opened this issue Feb 4, 2023 · 10 comments
Labels

Comments

@Iduoad
Copy link

Iduoad commented Feb 4, 2023

Describe the bug
I can't open all the files in a selection, is there a way to do that or is it impossible as for now ?

To Reproduce
Steps to reproduce the behavior:

s *.pg
o sel
clifm: open: /home/user/Desktop/file.png: Permission denied # this is the second file in selection
@leo-arch
Copy link
Owner

leo-arch commented Feb 4, 2023

Hi @Iduoad. Thanks for your feedback.

As of now, it is not possible to open multiple files at once: the second parameter, if any, is taken as an opening application (and since yours is a regular file, clifm spits out a Permission denied error).

I guess adding multi-open support for the open function would be a nice improvement. For the time being, a proper error message will be added to let the user know the cause of the error.

@Iduoad
Copy link
Author

Iduoad commented Feb 4, 2023

Thank you for the awesome work @leo-arch

@leo-arch
Copy link
Owner

leo-arch commented Feb 5, 2023

Proper error message added.

@leo-arch
Copy link
Owner

leo-arch commented Feb 5, 2023

Hi @Iduoad. Though we don't have multi-open right now (and I'm still not sure about this feature), there's still a workaround to get more or less what you want:

  1. Select the desired files, say, s *.png
  2. Open these files with the desired application, say: sxiv sel (then use n and p to navigate through your images)

Note: Of course, it depends on the application whether or not it can handle multiple files at once (and what file types it can handle)

Note 2: sel is not the only way. If you've tagged files as images, you can issue: sxiv t:images. You can also group files by MIME type, for example: sxiv @image.

True, the auto-open function is lost here, but it pretty much does the trick.

Hope it helps.

@Slackadays
Copy link
Contributor

@leo-arch I have an idea of how to fix this. What if you checked any paraneters after the first and see if they're an application or file? If it's a valid program, then use that to open the file, but if it isn't, consider it a selected file instead. That way, you can have you cake and eat it too, as you now can specify an application to open a single file with, automatically open two or more files, or specify application(s) to open one or many files. Basically, you open all files with all applications provided with clifm automatically determining what to use when you run the command.

@leo-arch
Copy link
Owner

Basically, it is already working that way, except that only for single files. For example, FILE will open FILE with the default application, whereas FILE APP will open FILE with APP.

The thing is to make it work with multiple files. This is already in my TODO list. Version 1.11 will be released in a few days, so, maybe for the next release.

@Slackadays
Copy link
Contributor

I was thinking the killer feature would be to have it available in the format of FILE FILE APP APP where you can have each APP open both FILEs and handle any combination of that. Taking it further, FILE APP APP APP or FILE FILE FILE APP APP APP APP because I can think of a couple workflows where you want multiple things to handle multiple items at the same time. In that way, clifm acts completely generically and doesn't put you into a box of one app only.

@leo-arch
Copy link
Owner

That would be nice indeed.

@Docbroke
Copy link
Contributor

Docbroke commented Apr 8, 2023

This is nice but complicated. How clifm will know, which of the given argument is APP and which one is FILE ? It will require clifm to check every argument. Even more trouble if current directory is in $PATH, where every argument will be FILE in current path as well as APP

@Slackadays
Copy link
Contributor

It will require clifm to check every argument.

That was kind of the point, so that clifm does the hard work for us so the user doesn't have to.

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

No branches or pull requests

4 participants