Skip to content

Commit

Permalink
feat: support for Yazi 0.4, sxyazi/yazi#1953
Browse files Browse the repository at this point in the history
  • Loading branch information
sxyazi committed Nov 26, 2024
1 parent c04be98 commit 4f127be
Show file tree
Hide file tree
Showing 8 changed files with 207 additions and 48 deletions.
49 changes: 40 additions & 9 deletions catppuccin-frappe.yazi/flavor.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,39 +36,70 @@ border_style = { fg = "#838ba7" }
# : }}}


# : Status {{{
# : Mode {{{

[mode]

normal_main = { fg = "#303446", bg = "#8caaee", bold = true }
normal_alt = { fg = "#8caaee", bg = "#414559" }

# Select mode
select_main = { fg = "#303446", bg = "#a6d189", bold = true }
select_alt = { fg = "#a6d189", bg = "#414559" }

# Unset mode
unset_main = { fg = "#303446", bg = "#eebebe", bold = true }
unset_alt = { fg = "#eebebe", bg = "#414559" }

# : }}}


# : Status bar {{{

[status]
separator_open = ""
separator_close = ""
separator_style = { fg = "#51576d", bg = "#51576d" }

# Mode
mode_normal = { fg = "#303446", bg = "#8caaee", bold = true }
mode_select = { fg = "#303446", bg = "#a6d189", bold = true }
mode_unset = { fg = "#303446", bg = "#eebebe", bold = true }

# Progress
progress_label = { fg = "#ffffff", bold = true }
progress_normal = { fg = "#8caaee", bg = "#51576d" }
progress_error = { fg = "#e78284", bg = "#51576d" }

# Permissions
perm_sep = { fg = "#838ba7" }
perm_type = { fg = "#8caaee" }
perm_read = { fg = "#e5c890" }
perm_write = { fg = "#e78284" }
perm_exec = { fg = "#a6d189" }

# TODO: -- remove these once Yazi 0.4 gets released
separator_style = { fg = "#414559", bg = "#414559" }
mode_normal = { fg = "#303446", bg = "#8caaee", bold = true }
mode_select = { fg = "#303446", bg = "#a6d189", bold = true }
mode_unset = { fg = "#303446", bg = "#eebebe", bold = true }
permissions_t = { fg = "#8caaee" }
permissions_r = { fg = "#e5c890" }
permissions_w = { fg = "#e78284" }
permissions_x = { fg = "#a6d189" }
permissions_s = { fg = "#838ba7" }
# TODO: remove these once Yazi 0.4 gets released --

# : }}}


# : Select {{{
# : Pick {{{

[pick]
border = { fg = "#8caaee" }
active = { fg = "#f4b8e4", bold = true }
inactive = {}

# TODO: -- remove these once Yazi 0.4 gets released
[select]
border = { fg = "#8caaee" }
active = { fg = "#f4b8e4", bold = true }
inactive = {}
# TODO: remove these once Yazi 0.4 gets released --

# : }}}

Expand Down Expand Up @@ -121,7 +152,7 @@ separator_style = { fg = "#626880" }
on = { fg = "#81c8be" }
run = { fg = "#f4b8e4" }
hovered = { reversed = true, bold = true }
footer = { fg = "#51576d", bg = "#c6d0f5" }
footer = { fg = "#414559", bg = "#c6d0f5" }

# : }}}

Expand Down
49 changes: 40 additions & 9 deletions catppuccin-latte.yazi/flavor.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,39 +36,70 @@ border_style = { fg = "#8c8fa1" }
# : }}}


# : Status {{{
# : Mode {{{

[mode]

normal_main = { fg = "#eff1f5", bg = "#1e66f5", bold = true }
normal_alt = { fg = "#1e66f5", bg = "#ccd0da" }

# Select mode
select_main = { fg = "#eff1f5", bg = "#40a02b", bold = true }
select_alt = { fg = "#40a02b", bg = "#ccd0da" }

# Unset mode
unset_main = { fg = "#eff1f5", bg = "#dd7878", bold = true }
unset_alt = { fg = "#dd7878", bg = "#ccd0da" }

# : }}}


# : Status bar {{{

[status]
separator_open = ""
separator_close = ""
separator_style = { fg = "#bcc0cc", bg = "#bcc0cc" }

# Mode
mode_normal = { fg = "#eff1f5", bg = "#1e66f5", bold = true }
mode_select = { fg = "#eff1f5", bg = "#40a02b", bold = true }
mode_unset = { fg = "#eff1f5", bg = "#dd7878", bold = true }

# Progress
progress_label = { fg = "#ffffff", bold = true }
progress_normal = { fg = "#1e66f5", bg = "#bcc0cc" }
progress_error = { fg = "#d20f39", bg = "#bcc0cc" }

# Permissions
perm_sep = { fg = "#8c8fa1" }
perm_type = { fg = "#1e66f5" }
perm_read = { fg = "#df8e1d" }
perm_write = { fg = "#d20f39" }
perm_exec = { fg = "#40a02b" }

# TODO: -- remove these once Yazi 0.4 gets released
separator_style = { fg = "#ccd0da", bg = "#ccd0da" }
mode_normal = { fg = "#eff1f5", bg = "#1e66f5", bold = true }
mode_select = { fg = "#eff1f5", bg = "#40a02b", bold = true }
mode_unset = { fg = "#eff1f5", bg = "#dd7878", bold = true }
permissions_t = { fg = "#1e66f5" }
permissions_r = { fg = "#df8e1d" }
permissions_w = { fg = "#d20f39" }
permissions_x = { fg = "#40a02b" }
permissions_s = { fg = "#8c8fa1" }
# TODO: remove these once Yazi 0.4 gets released --

# : }}}


# : Select {{{
# : Pick {{{

[pick]
border = { fg = "#1e66f5" }
active = { fg = "#ea76cb", bold = true }
inactive = {}

# TODO: -- remove these once Yazi 0.4 gets released
[select]
border = { fg = "#1e66f5" }
active = { fg = "#ea76cb", bold = true }
inactive = {}
# TODO: remove these once Yazi 0.4 gets released --

# : }}}

Expand Down Expand Up @@ -121,7 +152,7 @@ separator_style = { fg = "#acb0be" }
on = { fg = "#179299" }
run = { fg = "#ea76cb" }
hovered = { reversed = true, bold = true }
footer = { fg = "#bcc0cc", bg = "#4c4f69" }
footer = { fg = "#ccd0da", bg = "#4c4f69" }

# : }}}

Expand Down
2 changes: 1 addition & 1 deletion catppuccin-macchiato.yazi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Add these lines to your `theme.toml` to set this flavor as your _dark_ flavor:
[flavor]
use = "catppuccin-macchiato"
# For upcoming Yazi 0.4 (nightly version):
light = "catppuccin-macchiato"
dark = "catppuccin-macchiato"
```

## 📜 License
Expand Down
49 changes: 40 additions & 9 deletions catppuccin-macchiato.yazi/flavor.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,39 +36,70 @@ border_style = { fg = "#8087a2" }
# : }}}


# : Status {{{
# : Mode {{{

[mode]

normal_main = { fg = "#24273a", bg = "#8aadf4", bold = true }
normal_alt = { fg = "#8aadf4", bg = "#363a4f" }

# Select mode
select_main = { fg = "#24273a", bg = "#a6da95", bold = true }
select_alt = { fg = "#a6da95", bg = "#363a4f" }

# Unset mode
unset_main = { fg = "#24273a", bg = "#f0c6c6", bold = true }
unset_alt = { fg = "#f0c6c6", bg = "#363a4f" }

# : }}}


# : Status bar {{{

[status]
separator_open = ""
separator_close = ""
separator_style = { fg = "#494d64", bg = "#494d64" }

# Mode
mode_normal = { fg = "#24273a", bg = "#8aadf4", bold = true }
mode_select = { fg = "#24273a", bg = "#a6da95", bold = true }
mode_unset = { fg = "#24273a", bg = "#f0c6c6", bold = true }

# Progress
progress_label = { fg = "#ffffff", bold = true }
progress_normal = { fg = "#8aadf4", bg = "#494d64" }
progress_error = { fg = "#ed8796", bg = "#494d64" }

# Permissions
perm_sep = { fg = "#8087a2" }
perm_type = { fg = "#8aadf4" }
perm_read = { fg = "#eed49f" }
perm_write = { fg = "#ed8796" }
perm_exec = { fg = "#a6da95" }

# TODO: -- remove these once Yazi 0.4 gets released
separator_style = { fg = "#363a4f", bg = "#363a4f" }
mode_normal = { fg = "#24273a", bg = "#8aadf4", bold = true }
mode_select = { fg = "#24273a", bg = "#a6da95", bold = true }
mode_unset = { fg = "#24273a", bg = "#f0c6c6", bold = true }
permissions_t = { fg = "#8aadf4" }
permissions_r = { fg = "#eed49f" }
permissions_w = { fg = "#ed8796" }
permissions_x = { fg = "#a6da95" }
permissions_s = { fg = "#8087a2" }
# TODO: remove these once Yazi 0.4 gets released --

# : }}}


# : Select {{{
# : Pick {{{

[pick]
border = { fg = "#8aadf4" }
active = { fg = "#f5bde6", bold = true }
inactive = {}

# TODO: -- remove these once Yazi 0.4 gets released
[select]
border = { fg = "#8aadf4" }
active = { fg = "#f5bde6", bold = true }
inactive = {}
# TODO: remove these once Yazi 0.4 gets released --

# : }}}

Expand Down Expand Up @@ -121,7 +152,7 @@ separator_style = { fg = "#5b6078" }
on = { fg = "#8bd5ca" }
run = { fg = "#f5bde6" }
hovered = { reversed = true, bold = true }
footer = { fg = "#494d64", bg = "#cad3f5" }
footer = { fg = "#363a4f", bg = "#cad3f5" }

# : }}}

Expand Down
49 changes: 40 additions & 9 deletions catppuccin-mocha.yazi/flavor.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,39 +36,70 @@ border_style = { fg = "#7f849c" }
# : }}}


# : Status {{{
# : Mode {{{

[mode]

normal_main = { fg = "#1e1e2e", bg = "#89b4fa", bold = true }
normal_alt = { fg = "#89b4fa", bg = "#313244" }

# Select mode
select_main = { fg = "#1e1e2e", bg = "#a6e3a1", bold = true }
select_alt = { fg = "#a6e3a1", bg = "#313244" }

# Unset mode
unset_main = { fg = "#1e1e2e", bg = "#f2cdcd", bold = true }
unset_alt = { fg = "#f2cdcd", bg = "#313244" }

# : }}}


# : Status bar {{{

[status]
separator_open = ""
separator_close = ""
separator_style = { fg = "#45475a", bg = "#45475a" }

# Mode
mode_normal = { fg = "#1e1e2e", bg = "#89b4fa", bold = true }
mode_select = { fg = "#1e1e2e", bg = "#a6e3a1", bold = true }
mode_unset = { fg = "#1e1e2e", bg = "#f2cdcd", bold = true }

# Progress
progress_label = { fg = "#ffffff", bold = true }
progress_normal = { fg = "#89b4fa", bg = "#45475a" }
progress_error = { fg = "#f38ba8", bg = "#45475a" }

# Permissions
perm_sep = { fg = "#7f849c" }
perm_type = { fg = "#89b4fa" }
perm_read = { fg = "#f9e2af" }
perm_write = { fg = "#f38ba8" }
perm_exec = { fg = "#a6e3a1" }

# TODO: -- remove these once Yazi 0.4 gets released
separator_style = { fg = "#313244", bg = "#313244" }
mode_normal = { fg = "#1e1e2e", bg = "#89b4fa", bold = true }
mode_select = { fg = "#1e1e2e", bg = "#a6e3a1", bold = true }
mode_unset = { fg = "#1e1e2e", bg = "#f2cdcd", bold = true }
permissions_t = { fg = "#89b4fa" }
permissions_r = { fg = "#f9e2af" }
permissions_w = { fg = "#f38ba8" }
permissions_x = { fg = "#a6e3a1" }
permissions_s = { fg = "#7f849c" }
# TODO: remove these once Yazi 0.4 gets released --

# : }}}


# : Select {{{
# : Pick {{{

[pick]
border = { fg = "#89b4fa" }
active = { fg = "#f5c2e7", bold = true }
inactive = {}

# TODO: -- remove these once Yazi 0.4 gets released
[select]
border = { fg = "#89b4fa" }
active = { fg = "#f5c2e7", bold = true }
inactive = {}
# TODO: remove these once Yazi 0.4 gets released --

# : }}}

Expand Down Expand Up @@ -121,7 +152,7 @@ separator_style = { fg = "#585b70" }
on = { fg = "#94e2d5" }
run = { fg = "#f5c2e7" }
hovered = { reversed = true, bold = true }
footer = { fg = "#45475a", bg = "#cdd6f4" }
footer = { fg = "#313244", bg = "#cdd6f4" }

# : }}}

Expand Down
4 changes: 3 additions & 1 deletion scripts/catppuccin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ ya pack -a yazi-rs/flavors:catppuccin-{{ variant }}

## ⚙️ Usage

Add these lines to your `theme.toml` configuration file to use it:
Add these lines to your `theme.toml` to set this flavor as your _{{ mode }}_ flavor:

```toml
[flavor]
use = "catppuccin-{{ variant }}"
# For upcoming Yazi 0.4 (nightly version):
{{ mode }} = "catppuccin-{{ variant }}"
```

## 📜 License
Expand Down
4 changes: 3 additions & 1 deletion scripts/catppuccin/generate.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { variants, labels as colors } from "@catppuccin/palette"
import { readFile, writeFile } from "node:fs/promises"
import { join } from "node:path"
import { fileURLToPath } from "node:url"

import { labels as colors, variants } from "@catppuccin/palette"

const __dirname = fileURLToPath(new URL(".", import.meta.url))

const template = await readFile(join(__dirname, "./template.toml"), "utf8")
Expand All @@ -21,6 +22,7 @@ for (const variant of Object.keys(variants)) {
await writeFile(
join(__dirname, `../../catppuccin-${variant}.yazi/README.md`),
readme
.replaceAll("{{ mode }}", variant === "latte" ? "light" : "dark")
.replaceAll("{{ variant }}", variant)
.replaceAll("{{ variant_cap }}", variant.charAt(0).toUpperCase() + variant.slice(1)),
)
Expand Down
Loading

0 comments on commit 4f127be

Please sign in to comment.