package theme import ( "os/exec" "runtime" "strings" ) // Detect returns "flexoki-dark" or "flexoki-light" from the OS appearance. On // non-darwin platforms it returns dark. On macOS it reads the global // AppleInterfaceStyle key (unset in Light mode → empty output → light). func Detect() string { if runtime.GOOS != "darwin" { return "flexoki-dark" } out, _ := exec.Command("defaults", "read", "-g", "AppleInterfaceStyle").Output() return detectFrom(string(out)) } // detectFrom parses the raw `defaults read -g AppleInterfaceStyle` output. func detectFrom(raw string) string { if strings.Contains(raw, "Dark") { return "flexoki-dark" } return "flexoki-light" }