Skip to content

Commit 3a095a2

Browse files
authored
feat: add OrbStack support (#50)
1 parent a321626 commit 3a095a2

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

lua/auto-dark-mode/init.lua

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,18 @@ M.init = function()
5151

5252
if string.match(os_uname.release, "WSL") then
5353
M.state.system = "WSL"
54+
elseif string.match(os_uname.release, "orbstack") then
55+
M.state.system = "OrbStack"
5456
else
5557
M.state.system = os_uname.sysname
5658
end
5759

58-
if M.state.system == "Darwin" then
59-
M.state.query_command = { "defaults", "read", "-g", "AppleInterfaceStyle" }
60+
if M.state.system == "Darwin" or M.state.system == "OrbStack" then
61+
local query_command = { "defaults", "read", "-g", "AppleInterfaceStyle" }
62+
if M.state.system == "OrbStack" then
63+
query_command = vim.list_extend({ "mac" }, query_command)
64+
end
65+
M.state.query_command = query_command
6066
elseif M.state.system == "Linux" then
6167
if vim.fn.executable("dbus-send") == 0 then
6268
error(

lua/auto-dark-mode/interval.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ local function parse_query_response(stdout, stderr)
2727
else
2828
return M.options.fallback
2929
end
30-
elseif M.state.system == "Darwin" then
30+
elseif M.state.system == "Darwin" or M.state.system == "OrbStack" then
3131
return stdout == "Dark\n" and "dark" or "light"
3232
elseif M.state.system == "Windows_NT" or M.state.system == "WSL" then
3333
-- AppsUseLightTheme REG_DWORD 0x0 : dark

lua/auto-dark-mode/types.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---@meta
22

33
---@alias Appearance "light" | "dark"
4-
---@alias DetectedOS "Linux" | "Darwin" | "Windows_NT" | "WSL"
4+
---@alias DetectedOS "Linux" | "Darwin" | "Windows_NT" | "WSL" | "OrbStack"
55

66
---@class AutoDarkModeOptions
77
-- Optional. Fallback theme to use if the system theme can't be detected.

0 commit comments

Comments
 (0)