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

@ -14,6 +14,7 @@
"dressing.nvim": { "branch": "master", "commit": "5f44f829481640be0f96759c965ae22a3bcaf7ce" }, "dressing.nvim": { "branch": "master", "commit": "5f44f829481640be0f96759c965ae22a3bcaf7ce" },
"friendly-snippets": { "branch": "main", "commit": "009887b76f15d16f69ae1341f86a7862f61cf2a1" }, "friendly-snippets": { "branch": "main", "commit": "009887b76f15d16f69ae1341f86a7862f61cf2a1" },
"gitsigns.nvim": { "branch": "main", "commit": "bb808fc7376ed7bac0fbe8f47b83d4bf01738167" }, "gitsigns.nvim": { "branch": "main", "commit": "bb808fc7376ed7bac0fbe8f47b83d4bf01738167" },
"gruvbox-baby": { "branch": "main", "commit": "ea71b4225d0140103d99748ca4a33ecf22c03f62" },
"impatient.nvim": { "branch": "main", "commit": "969f2c5c90457612c09cf2a13fee1adaa986d350" }, "impatient.nvim": { "branch": "main", "commit": "969f2c5c90457612c09cf2a13fee1adaa986d350" },
"indent-blankline.nvim": { "branch": "master", "commit": "018bd04d80c9a73d399c1061fa0c3b14a7614399" }, "indent-blankline.nvim": { "branch": "master", "commit": "018bd04d80c9a73d399c1061fa0c3b14a7614399" },
"jaq-nvim": { "branch": "master", "commit": "236296aae555657487d1bb4d066cbde9d79d8cd4" }, "jaq-nvim": { "branch": "master", "commit": "236296aae555657487d1bb4d066cbde9d79d8cd4" },
@ -47,7 +48,6 @@
"nvim-web-devicons": { "branch": "master", "commit": "c3c1dc4e36969370ff589b7025df8ec2e5c881a2" }, "nvim-web-devicons": { "branch": "master", "commit": "c3c1dc4e36969370ff589b7025df8ec2e5c881a2" },
"plenary.nvim": { "branch": "master", "commit": "253d34830709d690f013daf2853a9d21ad7accab" }, "plenary.nvim": { "branch": "master", "commit": "253d34830709d690f013daf2853a9d21ad7accab" },
"smart-splits.nvim": { "branch": "master", "commit": "52b521618511b3a874255c8a717ace7155fd5f21" }, "smart-splits.nvim": { "branch": "master", "commit": "52b521618511b3a874255c8a717ace7155fd5f21" },
"sonokai": { "branch": "master", "commit": "e2e89497f178bec568a0a43cda651f0429ec8ec1" },
"symbols-outline.nvim": { "branch": "master", "commit": "512791925d57a61c545bc303356e8a8f7869763c" }, "symbols-outline.nvim": { "branch": "master", "commit": "512791925d57a61c545bc303356e8a8f7869763c" },
"telescope.nvim": { "branch": "master", "commit": "a3f17d3baf70df58b9d3544ea30abe52a7a832c2" }, "telescope.nvim": { "branch": "master", "commit": "a3f17d3baf70df58b9d3544ea30abe52a7a832c2" },
"todo-comments.nvim": { "branch": "main", "commit": "077c59586d9d0726b0696dc5680eb863f4e04bc5" }, "todo-comments.nvim": { "branch": "main", "commit": "077c59586d9d0726b0696dc5680eb863f4e04bc5" },

View file

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

View file

@ -80,6 +80,14 @@ if data_exists then
end end
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 { return {
-- color scheme -- color scheme
{ "luisiacc/gruvbox-baby", lazy = true, enabled = gruvbox }, { "luisiacc/gruvbox-baby", lazy = true, enabled = gruvbox },
@ -101,6 +109,9 @@ return {
vim.g.material_style = "palenight" vim.g.material_style = "palenight"
require("material").setup({ require("material").setup({
lualine_style = "stealth", lualine_style = "stealth",
disable = {
background = transparent,
},
}) })
end, end,
}, },
@ -112,6 +123,10 @@ return {
-- Lua -- Lua
require("onedark").setup({ require("onedark").setup({
style = "darker", style = "darker",
transparent = transparent,
lualine = {
transparent = transparent,
},
}) })
require("onedark").load() require("onedark").load()
end, 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({ require("catppuccin").setup({
flavour = "macchiato", -- latte, frappe, macchiato, mocha flavour = "macchiato", -- latte, frappe, macchiato, mocha
background = { -- :h background background = { -- :h background
light = "latte", light = "latte",
dark = "macchiato", dark = "macchiato",
}, },
transparent_background = true, transparent_background = transparent,
show_end_of_buffer = false, -- show the '~' characters after the end of buffers show_end_of_buffer = false, -- show the '~' characters after the end of buffers
term_colors = false, term_colors = false,
dim_inactive = { dim_inactive = {