Function: auto-dark--is-dark-mode-mac

auto-dark--is-dark-mode-mac is a natively compiled function defined in auto-dark.el.

Signature

(auto-dark--is-dark-mode-mac)

Documentation

Check if dark mode is enabled using mac-do-applescript.

Source Code

;; Defined in /nix/store/fxsazwcy8jcsigjhcydkb81ip47xqcw0-emacs-packages-deps/share/emacs/site-lisp/elpa/auto-dark-20260313.2356/auto-dark.el
(defun auto-dark--is-dark-mode-mac ()
  "Check if dark mode is enabled using `mac-do-applescript'."
  ;; FIXME: We shouldn’t need to check `fboundp' on every call, just when
  ;;        setting the detection method.
  (when (fboundp 'mac-do-applescript)
    (string-equal "\"true\""
                  (mac-do-applescript "tell application \"System Events\"
        tell appearance preferences
                if (dark mode) then
                        return \"true\"
                else
                        return \"false\"
                end if
        end tell
end tell"))))