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

[Feature Reuqest] Customize the open action #14

Open
DreamMaoMao opened this issue Apr 29, 2024 · 10 comments
Open

[Feature Reuqest] Customize the open action #14

DreamMaoMao opened this issue Apr 29, 2024 · 10 comments
Labels
enhancement New feature / Improvement suggestion or request
Milestone

Comments

@DreamMaoMao
Copy link

Currently, this tool can provide the ability to view images on the terminal, but it does not support the follow-up action after finding the desired image.

For example, if I find this image, I want to open it with some other tool, delete it, set it as a wallpaper, etc.

It is not necessary for the tool to do these specific actions, but if a key is pressed after selecting an image to exit the current tui and output the path of the selected image, then other tools can read the path and do subsequent things.

@DreamMaoMao DreamMaoMao added the enhancement New feature / Improvement suggestion or request label Apr 29, 2024
@AnonymouX47
Copy link
Owner

For example, if I find this image, I want to open it with some other tool, delete it, set it as a wallpaper, etc.

I understand you're talking about arbitrary actions but I think it's worth noting that deletion (for individual images only) is already implemented but just not in the image grid view primarily because the required underlying infrastructure is not yet in place. I'm willing to work on it (deletion in the grid view) though but won't be in the next release, as I don't want to delay things any further. 😁

It is not necessary for the tool to do these specific actions, but if a key is pressed after selecting an image to exit the current tui and output the path of the selected image, then other tools can read the path and do subsequent things.

I suppose you intend to pipe the output to another command or substitute it as an argument. There's one major flaw with this approach and it's that termvisage already produces other output. Do you have any suggestions about how to resolve this?

Another approach is copying to clipboard (file/directory name or path, image data, etc), which is already planned. What do you think about this?

Yet another is an "Open With..." dialog, where the user can type in a command with arguments and possibly placeholders for things like file/directory name/path, etc. This isn't planned yet and I haven't thought too far about it but it seems promising. What are your thoughts on this?

Whichever way this ends up going, please note that it's highly unlikely to make it into the next release.

Thank you. 😃

@AnonymouX47 AnonymouX47 modified the milestones: X.Y.Z, 0.3.0 Apr 30, 2024
@DreamMaoMao
Copy link
Author

What I mean is that after pressing an action similar to quit, clear the tui first, then print the path of the selected image, and then quit

@qrockz
Copy link

qrockz commented May 1, 2024

What I mean is that after pressing an action similar to quit, clear the tui first, then print the path of the selected image, and then quit

So termvisage can act like a File Picker?

  • Selecting multiple files and return their filenames (stdout)

@DreamMaoMao
Copy link
Author

What I mean is that after pressing an action similar to quit, clear the tui first, then print the path of the selected image, and then quit

So termvisage can act like a File Picker?

  • Selecting multiple files and return their filenames (stdout)
2024-05-01.18-14-34.mp4

like this

I noticed that many people reacted to many tui file managers, such as ranger,yazi, and joshuto, which cannot select images according to the preview image, so I wanted to make a plugin to support the selection of image files in the preview view

@qrockz
Copy link

qrockz commented May 1, 2024

What I mean is that after pressing an action similar to quit, clear the tui first, then print the path of the selected image, and then quit

So termvisage can act like a File Picker?

  • Selecting multiple files and return their filenames (stdout)

2024-05-01.18-14-34.mp4

like this

I noticed that many people reacted to many tui file managers, such as ranger,yazi, and joshuto, which cannot select images according to the preview image, so I wanted to make a plugin to support the selection of image files in the preview view

terminal_filepicker_firefox.mp4

I use yazi as a filepicker and can select multiple files (pictures included). But selecting files (pictures) in thumbnail mode would also be awesome.

@DreamMaoMao
Copy link
Author

What I mean is that after pressing an action similar to quit, clear the tui first, then print the path of the selected image, and then quit

So termvisage can act like a File Picker?

  • Selecting multiple files and return their filenames (stdout)

2024-05-01.18-14-34.mp4
like this
I noticed that many people reacted to many tui file managers, such as ranger,yazi, and joshuto, which cannot select images according to the preview image, so I wanted to make a plugin to support the selection of image files in the preview view

terminal_filepicker_firefox.mp4
I use yazi as a filepicker and can select multiple files (pictures included). But selecting files (pictures) in thumbnail mode would also be awesome.

How did you bind yazi as the default application on github attach file?

@qrockz
Copy link

qrockz commented May 1, 2024

What I mean is that after pressing an action similar to quit, clear the tui first, then print the path of the selected image, and then quit

So termvisage can act like a File Picker?

  • Selecting multiple files and return their filenames (stdout)

2024-05-01.18-14-34.mp4
like this
I noticed that many people reacted to many tui file managers, such as ranger,yazi, and joshuto, which cannot select images according to the preview image, so I wanted to make a plugin to support the selection of image files in the preview view

terminal_filepicker_firefox.mp4
I use yazi as a filepicker and can select multiple files (pictures included). But selecting files (pictures) in thumbnail mode would also be awesome.

How did you bind yazi as the default application on github attach file?

fpicker.txt
I'm on ubuntu. I've changed the filepicker for firefox systemwide. So whenever firefox want's to pick something it opens a terminal with yazi.

You have to make sure that

  • paths have to be adapted to your system
  • the 2 mentioned systemctl services have to be running
    note: the xdg-desktop-portal-termfilechooser repo didn't work out of the box for me (installer script installed the compiled files into wrong directories on my system) so I had to change some paths. Thus I wrote this howto for me so I can remember how I've installed yazi as a filepicker. It also works with thunderbird (yazi opens when I want to attach some files on an e-mail).

@DreamMaoMao
Copy link
Author

Unfortunately, I'm using chrome

@qrockz
Copy link

qrockz commented May 1, 2024

Unfortunately, I'm using chrome

it seems it also works on chrome :)
I think I have installed yazi systemwide as standard file picker. But sometimes you have to start applications (like thunderbird: GTK_USE_PORTAL=1 thunderbird) with some global variable to use the terminal file picker instead of the "standard" file picker (dolphin, nemo).

chromium-2024-05-01_15.48.21.mp4

@AnonymouX47
Copy link
Owner

Hmm 🤔... I see.

It's definitely possible to get this done.

The way I see it, based on the current design of the viewer, a new PICKER mode might have to be added, which would basically be a slight variation of the existing TUI mode enabled via a --picker command-line option (mutually exclusive with --cli and --tui).

Also, it'll be good to implement item selection before or alongside which would also lay the foundation for #3.

I'll put some more thought to it and get back to you as soon as I have something concrete enough for implementation.

Thank you very much. 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature / Improvement suggestion or request
Projects
None yet
Development

No branches or pull requests

3 participants