Skip to content

Commit

Permalink
fix: changed default to fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
Odilf authored and f-person committed Oct 9, 2024
1 parent 852732d commit fa92588
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lua/auto-dark-mode/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lua/auto-dark-mode/types.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit fa92588

Please sign in to comment.