1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 21:42:51 -05:00

matugen/template: Added neovim to matugen pipeline (#1097)

This commit is contained in:
Joaquim S.
2025-12-19 16:16:45 -03:00
committed by GitHub
parent 908b4b58cd
commit 6ef08c3d54
11 changed files with 99 additions and 1 deletions

View File

@@ -282,6 +282,7 @@ Singleton {
property bool matugenTemplateGhostty: true
property bool matugenTemplateKitty: true
property bool matugenTemplateFoot: true
property bool matugenTemplateNeovim: true
property bool matugenTemplateAlacritty: true
property bool matugenTemplateWezterm: true
property bool matugenTemplateDgop: true

View File

@@ -829,7 +829,7 @@ Singleton {
if (typeof SettingsData !== "undefined") {
const skipTemplates = [];
if (!SettingsData.runDmsMatugenTemplates) {
skipTemplates.push("gtk", "niri", "qt5ct", "qt6ct", "firefox", "pywalfox", "vesktop", "ghostty", "kitty", "foot", "alacritty", "wezterm", "dgop", "kcolorscheme", "vscode");
skipTemplates.push("gtk", "neovim", "niri", "qt5ct", "qt6ct", "firefox", "pywalfox", "vesktop", "ghostty", "kitty", "foot", "alacritty", "wezterm", "dgop", "kcolorscheme", "vscode");
} else {
if (!SettingsData.matugenTemplateGtk)
skipTemplates.push("gtk");
@@ -851,6 +851,8 @@ Singleton {
skipTemplates.push("kitty");
if (!SettingsData.matugenTemplateFoot)
skipTemplates.push("foot");
if (!SettingsData.matugenTemplateNeovim)
skipTemplates.push("nvim");
if (!SettingsData.matugenTemplateAlacritty)
skipTemplates.push("alacritty");
if (!SettingsData.matugenTemplateWezterm)

View File

@@ -182,6 +182,7 @@ var SPEC = {
matugenTemplateKitty: { def: true },
matugenTemplateFoot: { def: true },
matugenTemplateAlacritty: { def: true },
matugenTemplateNeovim: { def: true },
matugenTemplateWezterm: { def: true },
matugenTemplateDgop: { def: true },
matugenTemplateKcolorscheme: { def: true },

View File

@@ -846,6 +846,16 @@ Item {
checked: SettingsData.matugenTemplateFoot
onToggled: checked => SettingsData.set("matugenTemplateFoot", checked)
}
SettingsToggleRow {
tab: "theme"
tags: ["matugen", "neovim", "terminal", "template"]
settingKey: "matugenTemplateNeovim"
text: "neovim"
description: "Requires lazy plugin manager"
visible: SettingsData.runDmsMatugenTemplates
checked: SettingsData.matugenTemplateNeovim
onToggled: checked => SettingsData.set("matugenTemplateNeovim", checked)
}
SettingsToggleRow {
tab: "theme"

View File

@@ -117,6 +117,7 @@ Templates in `scripts/templates/` generate themes for:
- GTK 3/4
- Qt5/Qt6
- Alacritty, Kitty, Ghostty, Foot, Wezterm terminals
- Neovim
- VSCode/VSCodium
- Firefox

View File

@@ -0,0 +1,3 @@
[templates.dmsneovim]
input_path = 'SHELL_DIR/matugen/templates/neovim.lua'
output_path = '~/.config/nvim/lua/plugins/dankcolors.lua'

View File

@@ -0,0 +1,51 @@
return {
{
"RRethy/base16-nvim",
priority = 1000,
config = function()
require('base16-colorscheme').setup({
base00 = '{{colors.background.default.hex}}',
base01 = '{{colors.surface_container.default.hex}}',
base02 = '{{colors.surface_container_highest.default.hex}}',
base03 = '{{colors.outline_variant.default.hex}}',
base04 = '{{colors.on_surface_variant.default.hex}}',
base05 = '{{colors.on_surface.default.hex}}',
base06 = '{{colors.on_surface.default.hex}}',
base07 = '{{colors.inverse_on_surface.default.hex}}',
base08 = '{{colors.error.default.hex}}',
base09 = '{{colors.tertiary.default.hex}}',
base0A = '{{colors.on_surface_variant.default.hex}}',
base0B = '{{colors.primary.default.hex}}',
base0C = '{{colors.secondary.default.hex}}',
base0D = '{{colors.primary.default.hex}}',
base0E = '{{colors.secondary.default.hex}}',
base0F = '{{colors.error.default.hex}}',
})
local function set_hl_mutliple(groups, value)
for _, v in pairs(groups) do vim.api.nvim_set_hl(0, v, value) end
end
vim.api.nvim_set_hl(0, 'Visual',
{ bg = '{{colors.primary_container.default.hex}}', fg = '{{colors.on_primary_container.default.hex}}', bold = true })
vim.api.nvim_set_hl(0, 'LineNr', { fg = '{{colors.outline_variant.default.hex}}' })
vim.api.nvim_set_hl(0, 'CursorLineNr', { fg = '{{colors.primary.default.hex}}', bold = true })
local current_file_path = vim.fn.stdpath("config") .. "/lua/plugins/dankcolors.lua"
if not _G._matugen_theme_watcher then
local uv = vim.uv or vim.loop
_G._matugen_theme_watcher = uv.new_fs_event()
_G._matugen_theme_watcher:start(current_file_path, {}, vim.schedule_wrap(function()
local new_spec = dofile(current_file_path)
if new_spec and new_spec[1] and new_spec[1].config then
new_spec[1].config()
print("󰂖 Matugen: Colors reloaded!")
end
end))
end
end
}
}