auto dark/light theme (from darkman)
This commit is contained in:
+14
-1
@@ -2,6 +2,19 @@
|
||||
-- https://github.com/NvChad/ui/blob/v2.5/lua/nvconfig.lua
|
||||
-- Please read that file to know all available options :(
|
||||
|
||||
-- Get system theme from darkman
|
||||
local function get_system_theme()
|
||||
local handle = io.popen("darkman get 2>/dev/null")
|
||||
if handle then
|
||||
local result = handle:read("*a")
|
||||
handle:close()
|
||||
if result and result:match("light") then
|
||||
return "onenord_light"
|
||||
end
|
||||
end
|
||||
return "onenord" -- default dark theme
|
||||
end
|
||||
|
||||
---@type ChadrcConfig
|
||||
local M = {
|
||||
ui = {
|
||||
@@ -10,7 +23,7 @@ local M = {
|
||||
},
|
||||
},
|
||||
base46 = {
|
||||
theme = "onenord",
|
||||
theme = get_system_theme(),
|
||||
},
|
||||
|
||||
nvdash = {
|
||||
|
||||
Reference in New Issue
Block a user