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

Theme support for the spotter #1986

Open
3 tasks done
GrzegorzKozub opened this issue Dec 4, 2024 · 2 comments · Fixed by #2002
Open
3 tasks done

Theme support for the spotter #1986

GrzegorzKozub opened this issue Dec 4, 2024 · 2 comments · Fixed by #2002
Labels
feature New feature request

Comments

@GrzegorzKozub
Copy link
Contributor

yazi --debug output

Yazi
    Version: 0.3.3 (20dc055 2024-12-02)
    Debug  : false
    Triple : x86_64-unknown-linux-gnu (linux-x86_64)
    Rustc  : 1.83.0 (90b35a62 2024-11-26)

Ya
    Version: 0.3.3 (20dc055 2024-12-02)

Emulator
    Brand.from_env      : Some(Kitty)
    Emulator.detect     : Emulator { kind: Left(Kitty), light: false }
    Emulator.detect_full: Ok(Emulator { kind: Left(Kitty), light: false })

Adapter
    Adapter.matches: Kgp

Desktop
    XDG_SESSION_TYPE           : Some("wayland")
    WAYLAND_DISPLAY            : Some("wayland-0")
    DISPLAY                    : Some(":0")
    SWAYSOCK                   : None
    HYPRLAND_INSTANCE_SIGNATURE: None
    WAYFIRE_SOCKET             : None

SSH
    shared.in_ssh_connection: false

WSL
    WSL: false

Variables
    SHELL           : Some("/bin/zsh")
    EDITOR          : Some("nvim")
    VISUAL          : Some("nvim")
    YAZI_FILE_ONE   : None
    YAZI_CONFIG_HOME: None
    YAZI_ZOXIDE_OPTS: None
    FZF_DEFAULT_OPTS: Some("\n  --bind=ctrl-d:page-down,ctrl-u:page-up\n  --bind=alt-j:preview-down,alt-k:preview-up\n  --bind=alt-down:preview-down,alt-up:preview-up\n  --bind=alt-d:preview-page-down,alt-u:preview-page-up\n  --border none\n  --color dark\n  --color fg:bright-black,selected-fg:white,preview-fg:-1\n  --color hl:yellow,selected-hl:yellow\n  --color current-fg:-1,current-bg:-1,gutter:-1,current-hl:yellow\n  --color info:bright-black\n  --color border:bright-black\n  --color prompt:magenta\n  --color pointer:white,marker:white\n  --ellipsis \'…\'\n  --height 50%\n  --layout reverse-list\n  --margin 0\n  --marker \'• \'\n  --no-bold\n  --no-info\n  --no-scrollbar\n  --no-separator\n  --padding 0\n  --pointer \'●\'\n  --prompt \'●• \'\n  --scroll-off 3\n  --tabstop 2\n")

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

Multiplexers
    TMUX               : true
    tmux version       : 3.6
    tmux build flags   : enable-sixel=Unsupported
    ZELLIJ_SESSION_NAME: None
    Zellij version     : 0.41.2

Dependencies
    file          : 5.45
    ueberzugpp    : No such file or directory (os error 2)
    ffmpeg/ffprobe: 7.1 / 7.1
    pdftoppm      : 24.11.0
    magick        : 7.1.1-41
    fzf           : 0.56.3
    fd/fdfind     : 10.2.0 / No such file or directory (os error 2)
    rg            : 14.1.1
    chafa         : No such file or directory (os error 2)
    zoxide        : 0.9.6
    7z/7zz        : 24.09 / No such file or directory (os error 2)
    jq            : 1.7.1

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

Please describe the problem you're trying to solve

I was trying allow changing the spotter colors using themes but I think the THEME global is not available for Lua in plugins. It is available in components though.

Would you be willing to contribute this feature?

  • Yes, I'll give it a shot

Describe the solution you'd like

If someone could make THEME available in plugins then I could continue with the theme support.

Additional context

No response

Validations

  • I have searched the existing issues/discussions
  • The latest nightly build doesn't already have this feature
@GrzegorzKozub GrzegorzKozub added the feature New feature request label Dec 4, 2024
@sxyazi
Copy link
Owner

sxyazi commented Dec 4, 2024

I'm not sure I fully understand what you mean. Are you saying adding a new [spot] section in the theme.toml file, or are you just want to access other colors through THEME?

@sxyazi sxyazi added the waiting on op Waiting for more information from the original poster label Dec 4, 2024
@GrzegorzKozub
Copy link
Contributor Author

Adding a [spot] section and using it from the Rust code and Lua code in components is not a problem. I can do that.

However, to customize the colors for the spotter we need to access the THEME global in the Lua code for plugins. For example file.lua. Seems like this global is not installed there.

I may be wrong because for some reason when I run via cargo I don't get any messages in the log.

@github-actions github-actions bot removed the waiting on op Waiting for more information from the original poster label Dec 4, 2024
GrzegorzKozub added a commit to GrzegorzKozub/yazi-fork that referenced this issue Dec 6, 2024
Allows changing the colors of sxyazi#1802.
Fixes sxyazi#1986.
GrzegorzKozub added a commit to GrzegorzKozub/yazi-fork that referenced this issue Dec 20, 2024
Allows changing the colors of sxyazi#1802.
Fixes sxyazi#1986.
@sxyazi sxyazi reopened this Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants