Add yatline-gruvbox-material.yazi plugin

This commit is contained in:
2025-11-24 20:31:41 +07:00
parent bf0efd6910
commit bf0b91f120
4 changed files with 486 additions and 1 deletions

Submodule config/yazi/plugins/yatline-gruvbox-material.yazi deleted from 05ab2e308f

View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2024 imsi32
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -0,0 +1,99 @@
# yatline-gruvbox-material.yazi
Gruvbox Material theme for Yatline plugin.
## Illustration
> Gruvbox Material Hard Dark:
![header_hard_dark_normal](https://github.com/user-attachments/assets/1a34ebb5-63aa-494d-ab7d-bb66ff9bf653)
![header_hard_dark_select](https://github.com/user-attachments/assets/dd9e0f4b-4b0c-45e1-9bd3-f8527baa8db1)
![header_hard_dark_un-set](https://github.com/user-attachments/assets/a330f474-dd52-418a-af0e-c5ac12936d3f)
![status_hard_dark_normal](https://github.com/user-attachments/assets/d0071e24-9ddb-4d0b-8e2d-300c95035f8e)
![status_hard_dark_select](https://github.com/user-attachments/assets/57f2331e-ebb6-42ca-bd28-55404029663b)
![status_hard_dark_un-set](https://github.com/user-attachments/assets/606b02ce-86d5-456b-abc5-e7210f816aab)
> Gruvbox Material Medium Dark:
![header_medium_dark_normal](https://github.com/user-attachments/assets/b443e163-0531-4a80-94ce-ef53ccf90093)
![header_medium_dark_select](https://github.com/user-attachments/assets/cc937c4a-b7fd-447a-b60a-757f87176b99)
![header_medium_dark_un-set](https://github.com/user-attachments/assets/2ebe5a5b-9258-4999-86ec-d4cb56269359)
![status_medium_dark_normal](https://github.com/user-attachments/assets/fc4ff174-6fbe-4300-8adb-38c3dcc1fec7)
![status_medium_dark_select](https://github.com/user-attachments/assets/0a9699cf-50e2-4ba0-badc-66f1238f0a08)
![status_medium_dark_un-set](https://github.com/user-attachments/assets/ceef7065-7d73-4a31-b8f0-b5fc54ffb9ba)
> Gruvbox Material Soft Dark:
![header_soft_dark_normal](https://github.com/user-attachments/assets/8c230205-0619-4f87-9ad8-0d08e219034d)
![header_soft_dark_select](https://github.com/user-attachments/assets/073c2df6-f9f7-467f-b4a3-5ca01a577c1b)
![header_soft_dark_un-set](https://github.com/user-attachments/assets/c0ddd51d-facf-46b5-8ed5-90eef78e05bf)
![status_soft_dark_normal](https://github.com/user-attachments/assets/8b82d8a6-2322-4217-b948-2908e0959088)
![status_soft_dark_select](https://github.com/user-attachments/assets/18dd6c27-f2d2-444b-90cb-63a2c25e0bef)
![status_soft_dark_un-set](https://github.com/user-attachments/assets/7e61192b-f2f6-4908-adee-97f7f6a8d8f2)
> Gruvbox Material Hard Light:
![header_hard_light_normal](https://github.com/user-attachments/assets/557ee207-6d6e-4948-8d02-b64ff2a3413d)
![header_hard_light_select](https://github.com/user-attachments/assets/89ccac4a-feae-47c9-8a39-d106e0a22b5d)
![header_hard_light_un-set](https://github.com/user-attachments/assets/4355c183-3024-4cac-8f31-e50584c52787)
![status_hard_light_normal](https://github.com/user-attachments/assets/57ed4c1b-8905-4135-b737-ff34cc9605f0)
![status_hard_light_select](https://github.com/user-attachments/assets/89f75ac7-3201-49e5-bcd7-1929d90a4052)
![status_hard_light_un-set](https://github.com/user-attachments/assets/4fb505d3-d36a-4e75-9ec3-f14d3a5134af)
> Gruvbox Material Medium Light:
![header_medium_light_normal](https://github.com/user-attachments/assets/1e41531a-c80d-45ef-8cde-a66020a05624)
![header_medium_light_select](https://github.com/user-attachments/assets/3017c9da-0e5a-4d8a-82bb-198133a19454)
![header_medium_light_un-set](https://github.com/user-attachments/assets/fe986a94-9e9c-499f-98d8-bf57b4746725)
![status_medium_light_normal](https://github.com/user-attachments/assets/06c51301-9edb-40d2-bd18-40e652324933)
![status_medium_light_select](https://github.com/user-attachments/assets/b0fa02d5-cb09-4547-a62f-6b22c9d93397)
![status_medium_light_un-set](https://github.com/user-attachments/assets/a659d53f-6f86-4115-81bd-21513656a751)
> Gruvbox Material Soft Light:
![header_soft_light_normal](https://github.com/user-attachments/assets/857878c3-37f2-4ecd-9842-d154d8e2beeb)
![header_soft_light_select](https://github.com/user-attachments/assets/45ce8633-60cb-4bf8-bda7-7540243d0950)
![header_soft_light_un-set](https://github.com/user-attachments/assets/9b2b31fd-2fe5-4318-8184-2fdd2b9de5df)
![status_soft_light_normal](https://github.com/user-attachments/assets/e8631975-ddde-47ea-b2cb-a600efcaedb4)
![status_soft_light_select](https://github.com/user-attachments/assets/d0443703-f711-42de-a40a-e39037b4f982)
![status_soft_light_un-set](https://github.com/user-attachments/assets/c0c985ba-89f0-4cce-bb7b-6180124fdff7)
## Installation
### General
1) Download the repository.
2) If the directory is downloaded as zip file, extract it.
3) Rename the directory as `yatline-gruvbox-material.yazi`
4) Open the config directory of Yazi.
5) Copy this directory into `plugins` directory.
6) Create `init.lua` file in the main Yazi config directory.
7) Open this file and copy the config to that file.
### Linux
``` bash
git clone https://github.com/imsi32/yatline-gruvbox-material.yazi.git ~/.config/yazi/plugins/yatline-gruvbox-material.yazi
```
## Usage
Copy the following config to the `init.lua` file.
``` lua
local gruvbox_material_theme = require("yatline-gruvbox-material"):setup({ mode = "dark", toughness = "medium" }) -- or "light" -- or "hard" | "soft"
```
Then use the `theme` variable in Yatline config's theme paramater.
``` lua
require("yatline"):setup({
-- ===
theme = gruvbox_material_theme,
-- ===
})
```
## Credits
- [Gruvbox Material Theme](https://github.com/sainnhe/gruvbox-material)

View File

@@ -0,0 +1,366 @@
--=======================--
-- Gruvbox Material Dark --
--=======================--
local gruvbox_material_hard_dark_palette = {
bg_dim = "#141617",
bg0 = "#1d2021",
bg1 = "#282828",
bg2 = "#282828",
bg3 = "#3c3836",
bg4 = "#3c3836",
bg5 = "#504945",
bg_statusline1 = "#282828",
bg_statusline2 = "#32302f",
bg_statusline3 = "#504945",
bg_diff_green = "#32361a",
bg_diff_blue = "#0d3138",
bg_diff_red = "#3c1f1e",
bg_visual_green = "#333e34",
bg_visual_blue = "#2e3b3b",
bg_visual_yellow = "#473c29",
bg_visual_red = "#442e2d",
bg_current_word = "#32302f",
fg0 = "#d4be98",
fg1 = "#ddc7a1",
red = "#ea6962",
orange = "#e78a4e",
yellow = "#d8a657",
green = "#a9b665",
aqua = "#89b482",
blue = "#7daea3",
purple = "#d3869b",
gray0 = "#7c6f64",
gray1 = "#928374",
gray2 = "#a89984",
bg_green = "#a9b665",
bg_yellow = "#d8a657",
bg_red = "#ea6962",
}
local gruvbox_material_medium_dark_palette = {
bg_dim = "#1b1b1b",
bg0 = "#282828",
bg1 = "#32302f",
bg2 = "#32302f",
bg3 = "#45403d",
bg4 = "#45403d",
bg5 = "#5a524c",
bg_statusline1 = "#32302f",
bg_statusline2 = "#3a3735",
bg_statusline3 = "#504945",
bg_diff_green = "#34381b",
bg_diff_blue = "#0e363e",
bg_diff_red = "#402120",
bg_visual_green = "#3b4439",
bg_visual_blue = "#374141",
bg_visual_yellow = "#4f422e",
bg_visual_red = "#4c3432",
bg_current_word = "#3c3836",
fg0 = "#d4be98",
fg1 = "#ddc7a1",
red = "#ea6962",
orange = "#e78a4e",
yellow = "#d8a657",
green = "#a9b665",
aqua = "#89b482",
blue = "#7daea3",
purple = "#d3869b",
gray0 = "#7c6f64",
gray1 = "#928374",
gray2 = "#a89984",
bg_green = "#a9b665",
bg_yellow = "#d8a657",
bg_red = "#ea6962",
}
local gruvbox_material_soft_dark_palette = {
bg_dim = "#252423",
bg0 = "#32302f",
bg1 = "#3c3836",
bg2 = "#3c3836",
bg3 = "#504945",
bg4 = "#504945",
bg5 = "#665c54",
bg_statusline1 = "#3c3836",
bg_statusline2 = "#46413e",
bg_statusline3 = "#5b534d",
bg_diff_green = "#3d4220",
bg_diff_blue = "#0f3a42",
bg_diff_red = "#472322",
bg_visual_green = "#424a3e",
bg_visual_blue = "#404946",
bg_visual_yellow = "#574833",
bg_visual_red = "#543937",
bg_current_word = "#45403d",
fg0 = "#d4be98",
fg1 = "#ddc7a1",
red = "#ea6962",
orange = "#e78a4e",
yellow = "#d8a657",
green = "#a9b665",
aqua = "#89b482",
blue = "#7daea3",
purple = "#d3869b",
gray0 = "#7c6f64",
gray1 = "#928374",
gray2 = "#a89984",
bg_green = "#a9b665",
bg_yellow = "#d8a657",
bg_red = "#ea6962",
}
--- Gets the gruvbox material dark theme.
--- @param toughness string Tougness of theme: "hard", "soft" or "medium".
--- @return table theme Used in Yatline.
local function gruvbox_material_dark_theme(toughness)
local gruvbox_material_dark_palette
if toughness == "hard" then
gruvbox_material_dark_palette = gruvbox_material_hard_dark_palette
elseif toughness == "soft" then
gruvbox_material_dark_palette = gruvbox_material_soft_dark_palette
else
gruvbox_material_dark_palette = gruvbox_material_medium_dark_palette
end
return {
-- yatline
section_separator_open = "",
section_separator_close = "",
inverse_separator_open = "",
inverse_separator_close = "",
part_separator_open = "",
part_separator_close = "",
style_a = {
fg = gruvbox_material_dark_palette.bg0,
bg_mode = {
normal = gruvbox_material_dark_palette.gray2,
select = gruvbox_material_dark_palette.blue,
un_set = gruvbox_material_dark_palette.orange
}
},
style_b = { bg = gruvbox_material_dark_palette.bg5, fg = gruvbox_material_dark_palette.fg1 },
style_c = { bg = gruvbox_material_dark_palette.bg2, fg = gruvbox_material_dark_palette.fg1 },
permissions_t_fg = gruvbox_material_dark_palette.green,
permissions_r_fg = gruvbox_material_dark_palette.yellow,
permissions_w_fg = gruvbox_material_dark_palette.red,
permissions_x_fg = gruvbox_material_dark_palette.aqua,
permissions_s_fg = gruvbox_material_dark_palette.gray0,
selected = { icon = "󰻭", fg = gruvbox_material_dark_palette.yellow },
copied = { icon = "", fg = gruvbox_material_dark_palette.green },
cut = { icon = "", fg = gruvbox_material_dark_palette.red },
total = { icon = "󰮍", fg = gruvbox_material_dark_palette.yellow },
succ = { icon = "", fg = gruvbox_material_dark_palette.green },
fail = { icon = "", fg = gruvbox_material_dark_palette.red },
found = { icon = "󰮕", fg = gruvbox_material_dark_palette.blue },
processed = { icon = "󰐍", fg = gruvbox_material_dark_palette.green },
-- yatline-githead
prefix_color = gruvbox_material_dark_palette.fg1,
branch_color = gruvbox_material_dark_palette.blue,
commit_color = gruvbox_material_dark_palette.purple,
behind_color = gruvbox_material_dark_palette.orange,
ahead_color = gruvbox_material_dark_palette.aqua,
stashes_color = gruvbox_material_dark_palette.purple,
state_color = gruvbox_material_dark_palette.red,
staged_color = gruvbox_material_dark_palette.yellow,
unstaged_color = gruvbox_material_dark_palette.orange,
untracked_color = gruvbox_material_dark_palette.aqua,
}
end
--========================--
-- Gruvbox Material Light --
--========================--
local gruvbox_material_hard_light_palette = {
bg_dim = "#f3eac7",
bg0 = "#f9f5d7",
bg1 = "#f5edca",
bg2 = "#f3eac7",
bg3 = "#f2e5bc",
bg4 = "#eee0b7",
bg5 = "#ebdbb2",
bg_statusline1 = "#f5edca",
bg_statusline2 = "#f3eac7",
bg_statusline3 = "#eee0b7",
bg_diff_green = "#e4edc8",
bg_visual_green = "#dde5c2",
bg_diff_red = "#f8e4c9",
bg_visual_red = "#f0ddc3",
bg_diff_blue = "#e0e9d3",
bg_visual_blue = "#d9e1cc",
bg_visual_yellow = "#f9eabf",
bg_current_word = "#f3eac7",
fg0 = "#654735",
fg1 = "#4f3829",
red = "#c14a4a",
orange = "#c35e0a",
yellow = "#b47109",
green = "#6c782e",
aqua = "#4c7a5d",
blue = "#45707a",
purple = "#945e80",
bg_red = "#ae5858",
bg_green = "#6f8352",
bg_yellow = "#a96b2c",
gray0 = "#a89984",
gray1 = "#928374",
gray2 = "#7c6f64",
}
local gruvbox_material_medium_light_palette = {
bg_dim = '#f2e5bc',
bg0 = '#fbf1c7',
bg1 = '#f4e8be',
bg2 = '#f2e5bc',
bg3 = '#eee0b7',
bg4 = '#e5d5ad',
bg5 = '#ddccab',
bg_statusline1 = '#f2e5bc',
bg_statusline2 = '#f2e5bc',
bg_statusline3 = '#e5d5ad',
bg_diff_green = '#e6eabc',
bg_visual_green = '#dee2b6',
bg_diff_red = '#f9e0bb',
bg_visual_red = '#f1d9b5',
bg_diff_blue = '#e2e6c7',
bg_visual_blue = '#dadec0',
bg_visual_yellow = '#fae7b3',
bg_current_word = '#f2e5bc',
fg0 = '#654735',
fg1 = '#4f3829',
red = '#c14a4a',
orange = '#c35e0a',
yellow = '#b47109',
green = '#6c782e',
aqua = '#4c7a5d',
blue = '#45707a',
purple = '#945e80',
bg_red = '#ae5858',
bg_green = '#6f8352',
bg_yellow = '#a96b2c',
gray0 = '#a89984',
gray1 = '#928374',
gray2 = '#7c6f64',
}
local gruvbox_material_soft_light_palette = {
bg_dim = '#ebdbb2',
bg0 = '#f2e5bc',
bg1 = '#eddeb5',
bg2 = '#ebdbb2',
bg3 = '#e6d5ae',
bg4 = '#dac9a5',
bg5 = '#d5c4a1',
bg_statusline1 = '#ebdbb2',
bg_statusline2 = '#ebdbb2',
bg_statusline3 = '#dac9a5',
bg_diff_green = '#dfe1b4',
bg_visual_green = '#d7d9ae',
bg_diff_red = '#f7d9b9',
bg_visual_red = '#efd2b3',
bg_diff_blue = '#dbddbf',
bg_visual_blue = '#d3d5b8',
bg_visual_yellow = '#f3deaa',
bg_current_word = '#ebdbb2',
fg0 = '#654735',
fg1 = '#4f3829',
red = '#c14a4a',
orange = '#c35e0a',
yellow = '#b47109',
green = '#6c782e',
aqua = '#4c7a5d',
blue = '#45707a',
purple = '#945e80',
bg_red = '#ae5858',
bg_green = '#6f8352',
bg_yellow = '#a96b2c',
gray0 = '#a89984',
gray1 = '#928374',
gray2 = '#7c6f64',
}
--- Gets the gruvbox material light theme.
--- @param toughness string Tougness of theme: "hard", "soft" or "medium".
--- @return table theme Used in Yatline.
local function gruvbox_material_light_theme(toughness)
local gruvbox_material_light_palette
if toughness == "hard" then
gruvbox_material_light_palette = gruvbox_material_hard_light_palette
elseif toughness == "soft" then
gruvbox_material_light_palette = gruvbox_material_soft_light_palette
else
gruvbox_material_light_palette = gruvbox_material_medium_light_palette
end
return {
-- yatline
section_separator_open = "",
section_separator_close = "",
inverse_separator_open = "",
inverse_separator_close = "",
part_separator_open = "",
part_separator_close = "",
style_a = {
fg = gruvbox_material_light_palette.bg0,
bg_mode = {
normal = gruvbox_material_light_palette.gray2,
select = gruvbox_material_light_palette.blue,
un_set = gruvbox_material_light_palette.orange
}
},
style_b = { bg = gruvbox_material_light_palette.bg5, fg = gruvbox_material_light_palette.fg1 },
style_c = { bg = gruvbox_material_light_palette.bg2, fg = gruvbox_material_light_palette.fg1 },
permissions_t_fg = gruvbox_material_light_palette.green,
permissions_r_fg = gruvbox_material_light_palette.yellow,
permissions_w_fg = gruvbox_material_light_palette.red,
permissions_x_fg = gruvbox_material_light_palette.aqua,
permissions_s_fg = gruvbox_material_light_palette.gray2,
selected = { icon = "󰻭", fg = gruvbox_material_light_palette.yellow },
copied = { icon = "", fg = gruvbox_material_light_palette.green },
cut = { icon = "", fg = gruvbox_material_light_palette.red },
total = { icon = "󰮍", fg = gruvbox_material_light_palette.yellow },
succ = { icon = "", fg = gruvbox_material_light_palette.green },
fail = { icon = "", fg = gruvbox_material_light_palette.red },
found = { icon = "󰮕", fg = gruvbox_material_light_palette.blue },
processed = { icon = "󰐍", fg = gruvbox_material_light_palette.green },
-- yatline-githead
prefix_color = gruvbox_material_light_palette.fg1,
branch_color = gruvbox_material_light_palette.blue,
commit_color = gruvbox_material_light_palette.purple,
behind_color = gruvbox_material_light_palette.orange,
ahead_color = gruvbox_material_light_palette.aqua,
stashes_color = gruvbox_material_light_palette.purple,
state_color = gruvbox_material_light_palette.red,
staged_color = gruvbox_material_light_palette.yellow,
unstaged_color = gruvbox_material_light_palette.orange,
untracked_color = gruvbox_material_light_palette.aqua,
}
end
return { setup = function(_, args)
args = args or {}
local mode = args.mode or "dark"
local toughness = args.toughness or "medium"
if mode == "light" then
return gruvbox_material_light_theme(toughness)
else
return gruvbox_material_dark_theme(toughness)
end
end }