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

feat: flavor #753

Merged
merged 5 commits into from
Feb 29, 2024
Merged

feat: flavor #753

merged 5 commits into from
Feb 29, 2024

Conversation

sxyazi
Copy link
Owner

@sxyazi sxyazi commented Feb 29, 2024

@sxyazi sxyazi merged commit 9eab7b2 into main Feb 29, 2024
5 checks passed
@sxyazi sxyazi deleted the pr-cc2bec54 branch February 29, 2024 03:43
sxyazi added a commit that referenced this pull request Feb 29, 2024
sxyazi added a commit that referenced this pull request Feb 29, 2024
asim215 pushed a commit to asim215/yazi that referenced this pull request Mar 5, 2024
asim215 added a commit to asim215/yazi that referenced this pull request Mar 5, 2024
* ci: add cachix workflow (sxyazi#740)

* feat: add hovered as `$0` for shell and opener (sxyazi#738)

* feat: flavor (sxyazi#753)

* feat: add a new `[notify]` section to the `theme.toml` to configure the `notify` component's style (sxyazi#749)

* feat: switch to inline images protocol for VSCode, Tabby, and Hyper

* feat: add `prepend_rules` and `append_rules` for `[open]` in `yazi.toml` (sxyazi#754)

* feat: support `YAZI_FILE_ONE` environment variable for `file(1)` path (sxyazi#752)

* feat: allow both '/' and '\' in folder creation (sxyazi#751)

* perf: apply `add_many()`/`remove_many()` to the visual mode items for selection conflict detecting (sxyazi#758)

* feat: support `%0` as the hovered file for Windows (sxyazi#761)

* feat: `ya.input()` plugin API (sxyazi#762)

* fix: remove redundant check to allow operations on the `shell` command with an empty file list

* feat: add musl linux build targets (sxyazi#759)

* fix: nested conflict detection exception when performing cross-level searches (sxyazi#769)

* refactor: add new `run` property (sxyazi#773)

* feat: add `Ctrl-[` as an escape key (sxyazi#763)

* feat: add `parse` method to `Line` element

* feat: `ya.notify()` plugin API (sxyazi#780)

---------

Co-authored-by: musjj <72612857+musjj@users.noreply.github.com>
Co-authored-by: rrveex <91850165+rrveex@users.noreply.github.com>
Co-authored-by: sxyazi <sxyazi@gmail.com>
Co-authored-by: little camel <54983536+evpeople@users.noreply.github.com>
Co-authored-by: Filipe Paniguel <paniguel.lpnh@gmail.com>
Co-authored-by: Nguyễn Đức Toàn <33489972+ndtoan96@users.noreply.github.com>
Co-authored-by: Konrad Baran <65494005+uznog@users.noreply.github.com>
Co-authored-by: hankertrix <91734413+hankertrix@users.noreply.github.com>
@ningw42
Copy link

ningw42 commented Mar 31, 2024

The name 'flavor' is kind confusing to me. If we are going to make a 'flavor', would it be better if keymapping is also a part of a flavor? This isn't a feature request :P, just my random thoughts.

Maybe something off the topic, I encountered an unexpected error due to the new flavor feature. I am on NixOS and yazi is configured via home-manager. To match yazi's active development, I use xdg.configFile instead of the options provided by home-manager. I missed xdg.configFile..recursive which made $XDG_CONFIG_DIRS/yazi a read-only directory, which led to yazi's crash on boot due to the failure of flavor directory creation. I corrected my mistake, so yazi works as expected now. I switched to yazi right on the introduction of the plugins directory, I didn't encountered any similar issue (crash when missing the plugins directory) if I recall correctly. If anyone happens to have a read-only $XDG_CONFIG_DIRS/yazi, this might be confusing to him/her.

❯ RUST_BACKTRACE=full yazi
Backtrace (most recent call first):
  File "<unknown>", line 0, in better_panic::print_backtrace_info
  File "<unknown>", line 0, in better_panic::Settings::create_panic_handler::{{closure}}
  File "<unknown>", line 0, in yazi_shared::term::term::Term::goodbye
  File "<unknown>", line 0, in yazi::panic::Panic::install::{{closure}}

The application panicked (crashed).
  Failed to create flavor directory: Os { code: 30, kind: ReadOnlyFilesystem, message: "Read-only file system" }
in yazi-boot/src/boot.rs, line 108
thread: main

@sxyazi
Copy link
Owner Author

sxyazi commented Mar 31, 2024

Hi, flavor is a pre-made theme used to define a color scheme, not including key bindings, see https://yazi-rs.github.io/docs/flavors/overview for more details.

This issue arises from the fact that in newer versions of Yazi, it defaults to creating two directories, ~/.config/yazi/plugins and ~/.config/yazi/flavors, to allow users to conveniently install plugins and flavors with just one line of git clone, without needing to mkdir first and then git clone.

Unfortunately, this affects users with a read-only file system, and there is a fix for this, NixOS/nixpkgs#295846, but I'm not familiar with Nix, I cannot review it. Perhaps later I can create an issue to see if there are any Nix-savvy Yazi users who can help review it to prevent more people from encountering this issue.

@sxyazi sxyazi mentioned this pull request Mar 31, 2024
1 task
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants