support custom transparent background

This commit is contained in:
asep komarudin 2023-03-04 16:26:54 +07:00
parent 5d2a94b0db
commit 82eb5956d3
4 changed files with 38 additions and 5 deletions

View file

@ -57,9 +57,15 @@ m.section_separators = { left = "", right = " " }
-- nord
-- catppuccin
-- dracula
m.colorscheme = "sonokai"
m.colorscheme = "gruvbox-baby"
-- custom transparent mode
-- support gruvbox-baby, tokyonight, sonokai
-- only support
-- gruvbox-baby,
-- tokyonight,
-- sonokai,
-- material
-- onedark
-- catppuccin
-- 0 =off 1= on
m.transparent_mode = 1
m.transparent_mode = 0
return m

View file

@ -80,6 +80,14 @@ if data_exists then
end
end
local transparent = false
local transparent_mode = custom_ui.transparent_mode
if transparent_mode ~= nil then
if transparent_mode == 1 then
transparent = true
end
end
return {
-- color scheme
{ "luisiacc/gruvbox-baby", lazy = true, enabled = gruvbox },
@ -101,6 +109,9 @@ return {
vim.g.material_style = "palenight"
require("material").setup({
lualine_style = "stealth",
disable = {
background = transparent,
},
})
end,
},
@ -112,6 +123,10 @@ return {
-- Lua
require("onedark").setup({
style = "darker",
transparent = transparent,
lualine = {
transparent = transparent,
},
})
require("onedark").load()
end,

View file

@ -1,10 +1,22 @@
local transparent = false
local data_exists, custom_ui = pcall(require, "custom.ui")
if not data_exists then
return
end
local transparent_mode = custom_ui.transparent_mode
if transparent_mode ~= nil then
if transparent_mode == 1 then
transparent = true
end
end
require("catppuccin").setup({
flavour = "macchiato", -- latte, frappe, macchiato, mocha
background = { -- :h background
light = "latte",
dark = "macchiato",
},
transparent_background = true,
transparent_background = transparent,
show_end_of_buffer = false, -- show the '~' characters after the end of buffers
term_colors = false,
dim_inactive = {