From e182a3311318209542ef3572e937a08e4c7a5209 Mon Sep 17 00:00:00 2001 From: Sergei Zimmerman <145775305+xokdvium@users.noreply.github.com> Date: Wed, 1 Jan 2025 18:52:19 +0300 Subject: [PATCH 1/7] yazi: add testbed --- modules/yazi/testbed.nix | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 modules/yazi/testbed.nix diff --git a/modules/yazi/testbed.nix b/modules/yazi/testbed.nix new file mode 100644 index 000000000..e7f33260c --- /dev/null +++ b/modules/yazi/testbed.nix @@ -0,0 +1,26 @@ +{ pkgs, ... }: + +let + package = pkgs.yazi; +in + +{ + stylix.testbed.application = { + enable = true; + name = "yazi"; + inherit package; + }; + + home-manager.sharedModules = [ + { + programs.yazi = { + enable = true; + inherit package; + }; + + home.packages = [ + pkgs.nerd-fonts.fira-mono + ]; + } + ]; +} From 526b9772a0275e6073920e86bbdcc56a4bf51a71 Mon Sep 17 00:00:00 2001 From: Sergei Zimmerman <145775305+xokdvium@users.noreply.github.com> Date: Wed, 1 Jan 2025 15:18:02 +0300 Subject: [PATCH 2/7] yazi: reverse marker_selected -> marker_copied --- modules/yazi/hm.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/yazi/hm.nix b/modules/yazi/hm.nix index 7cfe115d9..d17b86007 100644 --- a/modules/yazi/hm.nix +++ b/modules/yazi/hm.nix @@ -28,8 +28,8 @@ preview_hovered = hovered; find_keyword = (mkFg base0B) // {bold = true;}; find_position = mkFg base05; - marker_selected = mkSame base0B; - marker_copied = mkSame base0A; + marker_selected = mkSame base0A; + marker_copied = mkSame base0B; marker_cut = mkSame base08; tab_active = mkBoth base00 base0D; tab_inactive = mkBoth base05 base01; From 571b30db8b554f7b4b42aaaea85af63e965b2bb2 Mon Sep 17 00:00:00 2001 From: Sergei Zimmerman <145775305+xokdvium@users.noreply.github.com> Date: Wed, 1 Jan 2025 15:32:39 +0300 Subject: [PATCH 3/7] yazi: migrate highlight colors to mnemonics This greatly improves readability and simplifies the process of reusing upstream templates [1] in stylix modules. Migration done with a simple bash script: ```bash colors_base=("base08" "base09" "base0A" "base0B" "base0C" "base0D" "base0E" "base0F") colors_name=("red" "orange" "yellow" "green" "cyan" "blue" "magenta" "brown") for i in "${!colors_base[@]}"; do sed -i "s/${colors_base[i]}/${colors_name[i]}/g" modules/yazi/hm.nix done ``` [1] https://github.com/yazi-rs/flavors/blob/main/scripts/catppuccin/template.toml --- modules/yazi/hm.nix | 82 ++++++++++++++++++++++----------------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/modules/yazi/hm.nix b/modules/yazi/hm.nix index d17b86007..e77139037 100644 --- a/modules/yazi/hm.nix +++ b/modules/yazi/hm.nix @@ -23,70 +23,70 @@ extension = ".tmTheme"; }; - cwd = mkFg base0C; + cwd = mkFg cyan; hovered = (mkBoth base05 base03) // {bold = true;}; preview_hovered = hovered; - find_keyword = (mkFg base0B) // {bold = true;}; + find_keyword = (mkFg green) // {bold = true;}; find_position = mkFg base05; - marker_selected = mkSame base0A; - marker_copied = mkSame base0B; - marker_cut = mkSame base08; - tab_active = mkBoth base00 base0D; + marker_selected = mkSame yellow; + marker_copied = mkSame green; + marker_cut = mkSame red; + tab_active = mkBoth base00 blue; tab_inactive = mkBoth base05 base01; border_style = mkFg base04; }; status = { separator_style = mkSame base01; - mode_normal = (mkBoth base00 base0D) // {bold = true;}; - mode_select = (mkBoth base00 base0B) // {bold = true;}; - mode_unset = (mkBoth base00 base0F) // {bold = true;}; + mode_normal = (mkBoth base00 blue) // {bold = true;}; + mode_select = (mkBoth base00 green) // {bold = true;}; + mode_unset = (mkBoth base00 brown) // {bold = true;}; progress_label = mkBoth base05 base00; progress_normal = mkBoth base05 base00; - progress_error = mkBoth base08 base00; - permissions_t = mkFg base0D; - permissions_r = mkFg base0A; - permissions_w = mkFg base08; - permissions_x = mkFg base0B; - permissions_s = mkFg base0C; + progress_error = mkBoth red base00; + permissions_t = mkFg blue; + permissions_r = mkFg yellow; + permissions_w = mkFg red; + permissions_x = mkFg green; + permissions_s = mkFg cyan; }; select = { - border = mkFg base0D; - active = mkFg base0E; + border = mkFg blue; + active = mkFg magenta; inactive = mkFg base05; }; input = { - border = mkFg base0D; + border = mkFg blue; title = mkFg base05; value = mkFg base05; selected = mkBg base03; }; completion = { - border = mkFg base0D; - active = mkBoth base0E base03; + border = mkFg blue; + active = mkBoth magenta base03; inactive = mkFg base05; }; tasks = { - border = mkFg base0D; + border = mkFg blue; title = mkFg base05; hovered = mkBoth base05 base03; }; which = { mask = mkBg base02; - cand = mkFg base0C; - rest = mkFg base0F; + cand = mkFg cyan; + rest = mkFg brown; desc = mkFg base05; separator_style = mkFg base04; }; help = { - on = mkFg base0E; - run = mkFg base0C; + on = mkFg magenta; + run = mkFg cyan; desc = mkFg base05; hovered = mkBoth base05 base03; footer = mkFg base05; @@ -96,25 +96,25 @@ filetype.rules = let mkRule = mime: fg: {inherit mime fg;}; in [ - (mkRule "image/*" base0C) - (mkRule "video/*" base0A) - (mkRule "audio/*" base0A) + (mkRule "image/*" cyan) + (mkRule "video/*" yellow) + (mkRule "audio/*" yellow) - (mkRule "application/zip" base0E) - (mkRule "application/gzip" base0E) - (mkRule "application/x-tar" base0E) - (mkRule "application/x-bzip" base0E) - (mkRule "application/x-bzip2" base0E) - (mkRule "application/x-7z-compressed" base0E) - (mkRule "application/x-rar" base0E) - (mkRule "application/xz" base0E) + (mkRule "application/zip" magenta) + (mkRule "application/gzip" magenta) + (mkRule "application/x-tar" magenta) + (mkRule "application/x-bzip" magenta) + (mkRule "application/x-bzip2" magenta) + (mkRule "application/x-7z-compressed" magenta) + (mkRule "application/x-rar" magenta) + (mkRule "application/xz" magenta) - (mkRule "application/doc" base0B) - (mkRule "application/pdf" base0B) - (mkRule "application/rtf" base0B) - (mkRule "application/vnd.*" base0B) + (mkRule "application/doc" green) + (mkRule "application/pdf" green) + (mkRule "application/rtf" green) + (mkRule "application/vnd.*" green) - ((mkRule "inode/directory" base0D) // {bold = true;}) + ((mkRule "inode/directory" blue) // {bold = true;}) (mkRule "*" base05) ]; }; From 9807a525526cae42035777e893ea47115f8d959d Mon Sep 17 00:00:00 2001 From: Sergei Zimmerman <145775305+xokdvium@users.noreply.github.com> Date: Wed, 1 Jan 2025 15:44:57 +0300 Subject: [PATCH 4/7] yazi: remove 'x-' prefix from mimetypes Breaking change for 0.4.0 release from [1]. [1]: https://www.github.com/sxyazi/yazi/pull/1927 --- modules/yazi/hm.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/yazi/hm.nix b/modules/yazi/hm.nix index e77139037..ab0d5a8b3 100644 --- a/modules/yazi/hm.nix +++ b/modules/yazi/hm.nix @@ -102,11 +102,11 @@ (mkRule "application/zip" magenta) (mkRule "application/gzip" magenta) - (mkRule "application/x-tar" magenta) - (mkRule "application/x-bzip" magenta) - (mkRule "application/x-bzip2" magenta) - (mkRule "application/x-7z-compressed" magenta) - (mkRule "application/x-rar" magenta) + (mkRule "application/tar" magenta) + (mkRule "application/bzip" magenta) + (mkRule "application/bzip2" magenta) + (mkRule "application/7z-compressed" magenta) + (mkRule "application/rar" magenta) (mkRule "application/xz" magenta) (mkRule "application/doc" green) From ec07ec6399866db786ff4ab5e697ce1acb485f5b Mon Sep 17 00:00:00 2001 From: Sergei Zimmerman <145775305+xokdvium@users.noreply.github.com> Date: Wed, 1 Jan 2025 15:39:08 +0300 Subject: [PATCH 5/7] yazi: migrate select -> pick Breaking change for 0.4.0 release, according to the migration guide [1]: > 1.2 - Renamed the select component to pick component [1]: https://www.github.com/sxyazi/yazi/issues/1772 --- modules/yazi/hm.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/yazi/hm.nix b/modules/yazi/hm.nix index ab0d5a8b3..39150d380 100644 --- a/modules/yazi/hm.nix +++ b/modules/yazi/hm.nix @@ -51,7 +51,7 @@ permissions_s = mkFg cyan; }; - select = { + pick = { border = mkFg blue; active = mkFg magenta; inactive = mkFg base05; From 85af3dd7a2b813f01ada4e81de0826522541a5f8 Mon Sep 17 00:00:00 2001 From: Sergei Zimmerman <145775305+xokdvium@users.noreply.github.com> Date: Thu, 2 Jan 2025 00:48:49 +0300 Subject: [PATCH 6/7] yazi: permissions_{t,r,w,x,s} -> perm_{type,read,write,exec,sep} One of the breaking changes for 0.4.0 migration from [1]. [1] https://www.github.com/sxyazi/yazi/pull/1953 --- modules/yazi/hm.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/yazi/hm.nix b/modules/yazi/hm.nix index 39150d380..8475087ed 100644 --- a/modules/yazi/hm.nix +++ b/modules/yazi/hm.nix @@ -44,11 +44,11 @@ progress_label = mkBoth base05 base00; progress_normal = mkBoth base05 base00; progress_error = mkBoth red base00; - permissions_t = mkFg blue; - permissions_r = mkFg yellow; - permissions_w = mkFg red; - permissions_x = mkFg green; - permissions_s = mkFg cyan; + perm_type = mkFg blue; + perm_read = mkFg yellow; + perm_write = mkFg red; + perm_exec = mkFg green; + perm_sep = mkFg cyan; }; pick = { From d27a2b11ee007b82da7bfd95172414089b2dec36 Mon Sep 17 00:00:00 2001 From: Sergei Zimmerman <145775305+xokdvium@users.noreply.github.com> Date: Thu, 2 Jan 2025 01:07:54 +0300 Subject: [PATCH 7/7] yazi: replace mode_* with mode.*_{main,alt} settings Yet another breakage from [1] for 0.4.0 changes. This fixes the unreadable status bar issue. [1] https://www.github.com/sxyazi/yazi/pull/1953 --- modules/yazi/hm.nix | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/modules/yazi/hm.nix b/modules/yazi/hm.nix index 8475087ed..7ff40c561 100644 --- a/modules/yazi/hm.nix +++ b/modules/yazi/hm.nix @@ -36,11 +36,16 @@ border_style = mkFg base04; }; + mode = { + normal_main = (mkBoth base00 blue) // {bold = true;}; + normal_alt = mkBoth blue base00; + select_main = (mkBoth base00 green) // {bold = true;}; + select_alt = mkBoth green base00; + unset_main = (mkBoth base00 brown) // {bold = true;}; + unset_alt = mkBoth brown base00; + }; + status = { - separator_style = mkSame base01; - mode_normal = (mkBoth base00 blue) // {bold = true;}; - mode_select = (mkBoth base00 green) // {bold = true;}; - mode_unset = (mkBoth base00 brown) // {bold = true;}; progress_label = mkBoth base05 base00; progress_normal = mkBoth base05 base00; progress_error = mkBoth red base00;