Function: auto-dark--current-system-mode

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

Signature

(auto-dark--current-system-mode)

Documentation

Return our best guess of the mode the system is in.

It can be dark, light, or nil.

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--current-system-mode ()
  "Return our best guess of the mode the system is in.
It can be dark, light, or nil."
  (or (pcase auto-dark-detection-method
        ('applescript
         (auto-dark--current-mode-applescript))
        ('osascript
         (if (auto-dark--is-dark-mode-osascript) 'dark 'light))
        ('dbus
         (auto-dark--current-mode-dbus))
        ('powershell
         (if (auto-dark--is-dark-mode-powershell) 'dark 'light))
        ('winreg
         (if (auto-dark--is-dark-mode-winreg) 'dark 'light))
        ('termux
         (if (auto-dark--is-dark-mode-termux) 'dark 'light)))
      (frame-parameter nil 'background-mode)
      ;; Let Emacs guess what the background should be.
      (frame-terminal-default-bg-mode nil)
      ;; Give up and just use the value we last set
      auto-dark--last-dark-mode-state
      (lwarn 'auto-dark
             :warning
             "couldn’t determine current system appearance")))