summaryrefslogtreecommitdiff
path: root/fedora/.config/yazi/flavors/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'fedora/.config/yazi/flavors/scripts')
-rw-r--r--fedora/.config/yazi/flavors/scripts/README.md36
-rw-r--r--fedora/.config/yazi/flavors/scripts/generate.js169
-rw-r--r--fedora/.config/yazi/flavors/scripts/template.toml189
3 files changed, 394 insertions, 0 deletions
diff --git a/fedora/.config/yazi/flavors/scripts/README.md b/fedora/.config/yazi/flavors/scripts/README.md
new file mode 100644
index 0000000..17a1ffe
--- /dev/null
+++ b/fedora/.config/yazi/flavors/scripts/README.md
@@ -0,0 +1,36 @@
+<div align="center">
+ <img src="https://github.com/sxyazi/yazi/blob/main/assets/logo.png?raw=true" alt="Yazi logo" width="20%">
+</div>
+
+<h3 align="center">
+ ${variant_cap} Flavor for <a href="https://github.com/sxyazi/yazi">Yazi</a>
+</h3>
+
+## 👀 Preview
+
+<img src="preview.png" width="600" />
+
+## 🎹 Installation
+
+```sh
+ya pkg add yazi-rs/flavors:${variant}
+```
+
+## ⚙ Usage
+
+Set the content of your `theme.toml` to enable it as your _${mode}_ flavor:
+
+```toml
+[flavor]
+${mode} = "${variant}"
+```
+
+Make sure your `theme.toml` doesn't contain anything other than `[flavor]`, unless you want to override certain styles of this flavor.
+
+See the [Yazi flavor documentation](https://yazi-rs.github.io/docs/flavors/overview) for more details.
+
+## 📜 License
+
+The flavor is MIT-licensed, and the included tmTheme is also MIT-licensed.
+
+Check the [LICENSE](LICENSE) and [LICENSE-tmtheme](LICENSE-tmtheme) file for more details.
diff --git a/fedora/.config/yazi/flavors/scripts/generate.js b/fedora/.config/yazi/flavors/scripts/generate.js
new file mode 100644
index 0000000..194de0f
--- /dev/null
+++ b/fedora/.config/yazi/flavors/scripts/generate.js
@@ -0,0 +1,169 @@
+import fs, { access, mkdir, readFile, writeFile } from "node:fs/promises"
+import { join } from "node:path"
+import { fileURLToPath } from "node:url"
+
+const __dirname = fileURLToPath(new URL(".", import.meta.url))
+
+const VARIANTS = {
+ "Dracula": {
+ text: "#f8f8f2",
+ background: "#282a36",
+
+ primary: "#bd93f9",
+ secondary: "#8be9fd",
+ tertiary: "#ffb86c",
+ accent: "#ff79c6",
+
+ surface: "#44475a",
+ surface1: "#63667d",
+ surface2: "#83869c",
+
+ onSurface: "#6272a4",
+ onSurface1: "#7282b5",
+ onSurface2: "#8998c9",
+
+ red: "#ff5555",
+ green: "#50fa7b",
+ blue: "#bd93f9",
+ yellow: "#f1fa8c",
+
+ _tmtheme: "https://raw.githubusercontent.com/dracula/sublime/refs/heads/master/Dracula.tmTheme",
+ _tmthemeLicense: "https://raw.githubusercontent.com/dracula/sublime/refs/heads/master/LICENSE",
+ },
+ "Catppuccin Macchiato": {
+ text: "#cad3f5",
+ background: "#24273a",
+
+ primary: "#8aadf4",
+ secondary: "#8bd5ca",
+ tertiary: "#f0c6c6",
+ accent: "#f5bde6",
+
+ surface: "#363a4f",
+ surface1: "#494d64",
+ surface2: "#5b6078",
+
+ onSurface: "#6e738d",
+ onSurface1: "#8087a2",
+ onSurface2: "#939ab7",
+
+ red: "#ed8796",
+ green: "#a6da95",
+ blue: "#8aadf4",
+ yellow: "#eed49f",
+
+ _tmtheme: "https://raw.githubusercontent.com/catppuccin/bat/refs/heads/main/themes/Catppuccin%20Macchiato.tmTheme",
+ _tmthemeLicense: "https://raw.githubusercontent.com/catppuccin/bat/refs/heads/main/LICENSE",
+ },
+ "Catppuccin Mocha": {
+ text: "#cdd6f4",
+ background: "#1e1e2e",
+
+ primary: "#89b4fa",
+ secondary: "#94e2d5",
+ tertiary: "#f2cdcd",
+ accent: "#f5c2e7",
+
+ surface: "#313244",
+ surface1: "#45475a",
+ surface2: "#585b70",
+
+ onSurface: "#6c7086",
+ onSurface1: "#7f849c",
+ onSurface2: "#9399b2",
+
+ red: "#f38ba8",
+ green: "#a6e3a1",
+ blue: "#89b4fa",
+ yellow: "#f9e2af",
+
+ _tmtheme: "https://raw.githubusercontent.com/catppuccin/bat/refs/heads/main/themes/Catppuccin%20Mocha.tmTheme",
+ _tmthemeLicense: "https://raw.githubusercontent.com/catppuccin/bat/refs/heads/main/LICENSE",
+ },
+ "Catppuccin Latte": {
+ text: "#4c4f69",
+ background: "#eff1f5",
+
+ primary: "#1e66f5",
+ secondary: "#179299",
+ tertiary: "#dd7878",
+ accent: "#ea76cb",
+
+ surface: "#ccd0da",
+ surface1: "#bcc0cc",
+ surface2: "#acb0be",
+
+ onSurface: "#9ca0b0",
+ onSurface1: "#8c8fa1",
+ onSurface2: "#7c7f93",
+
+ red: "#d20f39",
+ green: "#40a02b",
+ blue: "#1e66f5",
+ yellow: "#df8e1d",
+
+ _light: true,
+ _tmtheme: "https://raw.githubusercontent.com/catppuccin/bat/refs/heads/main/themes/Catppuccin%20Latte.tmTheme",
+ _tmthemeLicense: "https://raw.githubusercontent.com/catppuccin/bat/refs/heads/main/LICENSE",
+ },
+ "Catppuccin Frappe": {
+ text: "#c6d0f5",
+ background: "#303446",
+
+ primary: "#8caaee",
+ secondary: "#81c8be",
+ tertiary: "#eebebe",
+ accent: "#f4b8e4",
+
+ surface: "#414559",
+ surface1: "#51576d",
+ surface2: "#626880",
+
+ onSurface: "#737994",
+ onSurface1: "#838ba7",
+ onSurface2: "#949cbb",
+
+ red: "#e78284",
+ green: "#a6d189",
+ blue: "#8caaee",
+ yellow: "#e5c890",
+
+ _tmtheme: "https://raw.githubusercontent.com/catppuccin/bat/refs/heads/main/themes/Catppuccin%20Frappe.tmTheme",
+ _tmthemeLicense: "https://raw.githubusercontent.com/catppuccin/bat/refs/heads/main/LICENSE",
+ },
+}
+
+const template = await readFile(join(__dirname, "./template.toml"), "utf8")
+const readme = await readFile(join(__dirname, "./README.md"), "utf8")
+
+for (const [name, colors] of Object.entries(VARIANTS)) {
+ const lowerName = name.toLowerCase().replace(" ", "-")
+ const wd = join(__dirname, `../${lowerName}.yazi`)
+ try {
+ await access(wd)
+ } catch {
+ await mkdir(wd)
+ }
+
+ // flavor.toml
+ let s = template
+ for (const [name, color] of Object.entries(colors)) {
+ s = s.replaceAll(`\${${name}}`, color)
+ }
+ await writeFile(join(wd, "flavor.toml"), s.replaceAll("${variant}", lowerName))
+
+ // README.md
+ await writeFile(
+ join(wd, "README.md"),
+ readme
+ .replaceAll("${mode}", colors._light ? "light" : "dark")
+ .replaceAll("${variant}", lowerName)
+ .replaceAll("${variant_cap}", name),
+ )
+
+ // tmtheme.xml
+ await writeFile(join(wd, "tmtheme.xml"), await fetch(colors._tmtheme).then(r => r.text()))
+
+ // LICENSE-tmtheme
+ await writeFile(join(wd, "LICENSE-tmtheme"), await fetch(colors._tmthemeLicense).then(r => r.text()))
+}
diff --git a/fedora/.config/yazi/flavors/scripts/template.toml b/fedora/.config/yazi/flavors/scripts/template.toml
new file mode 100644
index 0000000..2eb31d2
--- /dev/null
+++ b/fedora/.config/yazi/flavors/scripts/template.toml
@@ -0,0 +1,189 @@
+# vim:fileencoding=utf-8:foldmethod=marker
+
+# : Manager {{{
+
+[mgr]
+cwd = { fg = "${secondary}" }
+
+# Hovered
+hovered = { reversed = true }
+preview_hovered = { underline = true }
+
+# Find
+find_keyword = { fg = "${yellow}", bold = true, italic = true, underline = true }
+find_position = { fg = "${accent}", bg = "reset", bold = true, italic = true }
+
+# Marker
+marker_copied = { fg = "${green}", bg = "${green}" }
+marker_cut = { fg = "${red}", bg = "${red}" }
+marker_marked = { fg = "${secondary}", bg = "${secondary}" }
+marker_selected = { fg = "${yellow}", bg = "${yellow}" }
+
+# Count
+count_copied = { fg = "${background}", bg = "${green}" }
+count_cut = { fg = "${background}", bg = "${red}" }
+count_selected = { fg = "${background}", bg = "${yellow}" }
+
+# Border
+border_symbol = "│"
+border_style = { fg = "${onSurface1}" }
+
+# : }}}
+
+
+# : Tabs {{{
+
+[tabs]
+active = { fg = "${background}", bg = "${primary}", bold = true }
+inactive = { fg = "${primary}", bg = "${surface}" }
+
+# : }}}
+
+
+# : Mode {{{
+
+[mode]
+
+normal_main = { fg = "${background}", bg = "${primary}", bold = true }
+normal_alt = { fg = "${primary}", bg = "${surface}" }
+
+# Select mode
+select_main = { fg = "${background}", bg = "${secondary}", bold = true }
+select_alt = { fg = "${secondary}", bg = "${surface}" }
+
+# Unset mode
+unset_main = { fg = "${background}", bg = "${tertiary}", bold = true }
+unset_alt = { fg = "${tertiary}", bg = "${surface}" }
+
+# : }}}
+
+
+# : Status bar {{{
+
+[status]
+# Permissions
+perm_sep = { fg = "${onSurface1}" }
+perm_type = { fg = "${blue}" }
+perm_read = { fg = "${yellow}" }
+perm_write = { fg = "${red}" }
+perm_exec = { fg = "${green}" }
+
+# Progress
+progress_label = { fg = "#ffffff", bold = true }
+progress_normal = { fg = "${primary}", bg = "${surface1}" }
+progress_error = { fg = "${primary}", bg = "${red}" }
+
+# : }}}
+
+
+# : Pick {{{
+
+[pick]
+border = { fg = "${primary}" }
+active = { fg = "${accent}", bold = true }
+inactive = {}
+
+# : }}}
+
+
+# : Input {{{
+
+[input]
+border = { fg = "${primary}" }
+title = {}
+value = {}
+selected = { reversed = true }
+
+# : }}}
+
+
+# : Completion {{{
+
+[cmp]
+border = { fg = "${primary}" }
+
+# : }}}
+
+
+# : Tasks {{{
+
+[tasks]
+border = { fg = "${primary}" }
+title = {}
+hovered = { fg = "${accent}", bold = true }
+
+# : }}}
+
+
+# : Which {{{
+
+[which]
+mask = { bg = "${surface}" }
+cand = { fg = "${secondary}" }
+rest = { fg = "${onSurface2}" }
+desc = { fg = "${accent}" }
+separator = " îȘœ "
+separator_style = { fg = "${surface2}" }
+
+# : }}}
+
+
+# : Help {{{
+
+[help]
+on = { fg = "${secondary}" }
+run = { fg = "${accent}" }
+hovered = { reversed = true, bold = true }
+footer = { fg = "${surface}", bg = "${text}" }
+
+# : }}}
+
+
+# : Spotter {{{
+
+[spot]
+border = { fg = "${primary}" }
+title = { fg = "${primary}" }
+tbl_col = { fg = "${secondary}" }
+tbl_cell = { fg = "${accent}", bg = "${surface1}" }
+
+# : }}}
+
+
+# : Notification {{{
+
+[notify]
+title_info = { fg = "${green}" }
+title_warn = { fg = "${yellow}" }
+title_error = { fg = "${red}" }
+
+# : }}}
+
+
+# : File-specific styles {{{
+
+[filetype]
+
+rules = [
+ # Images
+ { mime = "image/*", fg = "${secondary}" },
+
+ # Media
+ { mime = "{audio,video}/*", fg = "${yellow}" },
+
+ # Archives
+ { mime = "application/{zip,rar,7z*,tar,gzip,xz,zstd,bzip*,lzma,compress,archive,cpio,arj,xar,ms-cab*}", fg = "${accent}" },
+
+ # Documents
+ { mime = "application/{pdf,doc,rtf}", fg = "${green}" },
+
+ # Fallback
+ { url = "*", fg = "${text}" },
+ { url = "*/", fg = "${primary}" },
+
+ # TODO: remove
+ { name = "*", fg = "${text}" },
+ { name = "*/", fg = "${primary}" }
+]
+
+# : }}}