diff --git a/lua/auto-dark-mode/init.lua b/lua/auto-dark-mode/init.lua index 6934c1b..4801b72 100644 --- a/lua/auto-dark-mode/init.lua +++ b/lua/auto-dark-mode/init.lua @@ -19,7 +19,7 @@ local query_command local system ---@type "light" | "dark" -local default_theme; +local fallback; -- Parses the query response for each system ---@param res string @@ -35,7 +35,7 @@ local function parse_query_response(res) elseif string.match(res, "unit32 2") ~= nil then return false else - return default_theme == "dark" + return fallback == "dark" end elseif system == "Darwin" then return res == "Dark" @@ -158,7 +158,7 @@ local function setup(options) set_background("light") end update_interval = options.update_interval or 3000 - default_theme = options.default or "dark" + fallback = options.fallback or "dark" init() end diff --git a/lua/auto-dark-mode/types.lua b/lua/auto-dark-mode/types.lua index fb7a5a0..b841c2d 100644 --- a/lua/auto-dark-mode/types.lua +++ b/lua/auto-dark-mode/types.lua @@ -5,6 +5,6 @@ ---@field set_light_mode nil | fun(): nil -- Every `update_interval` milliseconds a theme check will be performed. ---@field update_interval number? --- Optional. Default theme to use if the system theme can't be detected. +-- Optional. Fallback theme to use if the system theme can't be detected. -- Useful for linux and environments without a desktop manager. ----@field default "light" | "dark" | nil +---@field fallback "light" | "dark" | nil