Skip to content

Instantly share code, notes, and snippets.

@rawnly
Created May 24, 2026 09:22
Show Gist options
  • Select an option

  • Save rawnly/bd15951a373b9e58ee6f3c25c94ee2de to your computer and use it in GitHub Desktop.

Select an option

Save rawnly/bd15951a373b9e58ee6f3c25c94ee2de to your computer and use it in GitHub Desktop.
local M = {}
M.colorschemes = {
dark = "cyberdream",
light = "cyberdream",
}
M.colorscheme = function()
local bg = vim.env.NVIM_BACKGROUND
if bg == nil then
local handle = io.popen("defaults read -g AppleInterfaceStyle 2>/dev/null")
if handle then
local out = handle:read("*a") or ""
handle:close()
bg = out:match("Dark") and "dark" or "light"
else
bg = "dark"
end
end
vim.o.background = bg
return bg == "dark" and M.colorschemes.dark or M.colorschemes.light
end
return M
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment