atlas-engineer / nyxt

Nyxt - the hacker's browser.
https://nyxt-browser.com/
9.7k stars 405 forks source link

Question: How to define external file chooser #3064

Open jonnieey opened 1 year ago

jonnieey commented 1 year ago

Is your feature request related to a problem? Please descrbe This is mainly a question rather than a feature request. I have difficulty with the native file chooser, it requires too much typing especially if directory paths are long

Describe the solution you'd like Define an external file chooser in configuration. (Maybe it can be done, I just don't know how)

Describe alternatives you've considered Using the native file chooser, got no options.

Additional context I use vifm file manager. I'd like to configure it such that when I want to choose a file it invoked. ex st -e vifm

aadcg commented 1 year ago

I have difficulty with the native file chooser, it requires too much typing especially if directory paths are long

Could you tell what is lacking for you with a specfic example?

Are you aware that Tab inserts the current suggestion (the current path) into the prompt's input area? Are you aware that Control-backspace goes up one directory?

Define an external file chooser in configuration. (Maybe it can be done, I just don't know how)

You need to define a command via define-command-global that calls uiop:launch-program (look at launch-external-editor for inspiration). Does that help?

aartaka commented 1 year ago

Look at process-file-chooser-request in source/renderer/gtk.lisp and redefine this function. Should work magically. Or not. I'm not really sure how to bridge Nyxt with an external file manager, but I'm pretty sure you know what you're doing, so good luck!

jonnieey commented 1 year ago

Could you tell what is lacking for you with a specfic example?

Perhaps bookmarks could be a nice feacture, takes you to certain directory instantly. Well, that's feature in vifm that I'm missing.

Are you aware that Tab inserts the current suggestion (the current path) into the prompt's input area? Are you aware that Control-backspace goes up one directory?

Yeah, I've used tabs and ctrl-backspace before

You need to define a command via define-command-global that calls uiop:launch-program (look at launch-external-editor for inspiration). Does that help?

Very new to lisp, but I'll try to hack my way, thanks. It helps thanks.

jonnieey commented 1 year ago

Look at process-file-chooser-request in source/renderer/gtk.lisp and redefine this function. Should work magically. Or not. I'm not really sure how to bridge Nyxt with an external file manager, but I'm pretty sure you know what you're doing, so good luck!

Very new to lisp but I'll try to hack it. Thanks for the pointer though.

aadcg commented 1 year ago

Perhaps bookmarks could be a nice feacture, takes you to certain directory instantly.

Good idea! Noted: add bookmarks paths to file-manager-mode.

@jonnieey note that @aartaka adviced you how to instruct the web renderer to use the file manager you want when it tries to open one. My suggestion was different in spirit: define a command that starts your favourite file manager "in-place".

jonnieey commented 1 year ago

Perhaps bookmarks could be a nice feacture, takes you to certain directory instantly.

Good idea! Noted: add bookmarks paths to file-manager-mode.

@jonnieey note that @aartaka adviced you how to instruct the web renderer to use the file manager you want when it tries to open one. My suggestion was different in spirit: define a command that starts your favourite file manager "in-place".

Noted, thanks