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

Folder Selection #2163

Closed
2 of 3 tasks
magdesign opened this issue Jan 5, 2025 · 10 comments
Closed
2 of 3 tasks

Folder Selection #2163

magdesign opened this issue Jan 5, 2025 · 10 comments
Labels
invalid This doesn't seem right

Comments

@magdesign
Copy link

magdesign commented Jan 5, 2025

yazi --debug output

yazi --debug

Yazi
    Version: 0.4.2 (VERGEN_IDEMPOTENT_OUTPUT 2024-12-20)
    Debug  : false
    Triple : aarch64-alpine-linux-musl (linux-aarch64)
    Rustc  : 1.83.0 (90b35a62 2024-11-26)

Ya
    Version: No such file or directory (os error 2)

Emulator
    Brand.from_env      : Some(Foot)
    Emulator.detect     : Emulator { kind: Left(Foot), light: false, cell_size: Some((26, 59)) }
    Emulator.detect_full: Ok(Emulator { kind: Left(Foot), light: false, cell_size: Some((26, 59)) })

Adapter
    Adapter.matches: Sixel

Desktop
    XDG_SESSION_TYPE           : Some("wayland")
    WAYLAND_DISPLAY            : Some("wayland-1")
    DISPLAY                    : Some(":0")
    SWAYSOCK                   : Some("/dev/shm/user/10000/sway-ipc.10000.3229.sock")
    HYPRLAND_INSTANCE_SIGNATURE: None
    WAYFIRE_SOCKET             : None

SSH
    shared.in_ssh_connection: false

WSL
    WSL: false

NVIM
    NVIM          : false
    Neovim version: No such file or directory (os error 2)

Variables
    SHELL           : Some("/bin/ash")
    EDITOR          : Some("micro")
    VISUAL          : None
    YAZI_FILE_ONE   : None
    YAZI_CONFIG_HOME: None
    YAZI_ZOXIDE_OPTS: None
    FZF_DEFAULT_OPTS: None

Text Opener
    default     : Some(Opener { run: "${EDITOR:-vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR", for_: None, spread: true })
    block-create: Some(Opener { run: "${EDITOR:-vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR", for_: None, spread: true })
    block-rename: Some(Opener { run: "${EDITOR:-vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR", for_: None, spread: true })

Multiplexers
    TMUX               : 0
    tmux version       : No such file or directory (os error 2)
    tmux build flags   : enable-sixel=Unknown
    ZELLIJ_SESSION_NAME: None
    Zellij version     : No such file or directory (os error 2)

Dependencies
    file          : 5.46
    ueberzugpp    : No such file or directory (os error 2)
    ffmpeg/ffprobe: 6.1.2 / 6.1.2
    pdftoppm      : No such file or directory (os error 2)
    magick        : 7.1.1-43
    fzf           : No such file or directory (os error 2)
    fd/fdfind     : 10.2.0 / No such file or directory (os error 2)
    rg            : No such file or directory (os error 2)
    chafa         : No such file or directory (os error 2)
    zoxide        : No such file or directory (os error 2)
    7z/7zz        : No such file or directory (os error 2) / No such file or directory (os error 2)
    jq            : 1.7.1

Clipboard
    wl-copy/paste: 2.2.1 / 2.2.1
    xclip        : No such file or directory (os error 2)
    xsel         : No such file or directory (os error 2)

Please describe the problem you're trying to solve

Using yazi as my default filepicker/filechooser which works well 🤓.

However, when an application like amberol asks to select a folder, i am not able to do this with yazi as filechooser. I can only select files and they are not even sent back to the application.

Would you be willing to contribute this feature?

  • Yes, I'll give it a shot

Describe the solution you'd like

If yazy gets opened as a filepicker via xdg-desktop-portal-termfilechooser to select a folder, hitting enter on any selected folder should accept this as an input, send it back to the application which requested it and close yazi.

Additional context

No response

Checklist

  • I have searched the existing issues/discussions
  • The latest nightly build doesn't already have this feature
@magdesign magdesign added the feature New feature request label Jan 5, 2025
@sxyazi
Copy link
Owner

sxyazi commented Jan 25, 2025

If I had to guess, you're referring to yazi --chooser-file. In that case, it already supports selecting directories. When you select and open one or more directories, Yazi will output the paths of those directories.

@sxyazi sxyazi added the waiting on op Waiting for more information from the original poster label Jan 25, 2025
@magdesign
Copy link
Author

how would i do this then?

when selecting a folder and pressing enter, i get:

Image

@github-actions github-actions bot removed the waiting on op Waiting for more information from the original poster label Jan 25, 2025
@magdesign
Copy link
Author

using it with xdg-desktop-portal-termfilechooser script: https://github.com/magdesign/xdg-desktop-portal-termfilechooser/blob/main/contrib/yazi-wrapper.sh

@sxyazi
Copy link
Owner

sxyazi commented Jan 25, 2025

Does yazi --chooser-file not print any paths?

@sxyazi sxyazi added the waiting on op Waiting for more information from the original poster label Jan 25, 2025
@magdesign
Copy link
Author

magdesign commented Jan 26, 2025

i am not sure what you mean, sorry

Image

when i do
yazi --chooser-file ~/Music/ yazi opens just as is, not even pointing at the choosen directory

@github-actions github-actions bot removed the waiting on op Waiting for more information from the original poster label Jan 26, 2025
@sxyazi
Copy link
Owner

sxyazi commented Jan 26, 2025

I'm a bit confused – I'm still not sure I understand the feature request.

Are you asking for something like the yazi --chooser-file option, and the current yazi --chooser-file just not working for you?

@sxyazi sxyazi added the waiting on op Waiting for more information from the original poster label Jan 26, 2025
@sxyazi
Copy link
Owner

sxyazi commented Jan 26, 2025

yazi --chooser-file ~/Music/

Why are you assigning it a directory? It should be a file like /tmp/test

@magdesign
Copy link
Author

I installed yazi and xdg-desktop-portal-filechooser. so yazi is my default filepicker whenever an application like firefox or amberol is asking for a file, yazi will pop-up.
This works very well for files, but when the application asks to select a folder i get the error mentioned above.
so it feels like there is a missing function to just select a folder.

@github-actions github-actions bot removed the waiting on op Waiting for more information from the original poster label Jan 26, 2025
@sxyazi
Copy link
Owner

sxyazi commented Jan 26, 2025

What you're looking for is exactly yazi --chooser-file - it supports selecting both files and directories, and also allows selecting multiple files or directories, each one will be listed on a separate line, you need to make sure that xdg-desktop-portal-filechooser handles those paths correctly.

Closing as already supported

@sxyazi sxyazi closed this as not planned Won't fix, can't repro, duplicate, stale Jan 26, 2025
@sxyazi sxyazi added invalid This doesn't seem right and removed feature New feature request labels Jan 26, 2025
@magdesign
Copy link
Author

magdesign commented Jan 26, 2025

so i need to dig in xdg-desktop-portal-filechooser wrapper script....
in the header it mentions to support folder selection..🤷

if anyone stumbles over this issue and knows how to solve, please tell us.
thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants