Function: auto-dark--determine-detection-method

auto-dark--determine-detection-method is a natively compiled function defined in auto-dark.el.

Signature

(auto-dark--determine-detection-method)

Documentation

Determine which theme detection method auto-dark should use.

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--determine-detection-method ()
  "Determine which theme detection method auto-dark should use."
  (cond
   ((and (eq system-type 'darwin)
         (or (fboundp 'ns-do-applescript)
             (fboundp 'mac-do-applescript))
         (or (eq window-system 'ns)
             (eq window-system 'mac)))
    'applescript)
   ((and (eq system-type 'darwin)
         auto-dark-allow-osascript)
    'osascript)
   ((and (eq system-type 'gnu/linux)
         (member 'dbus features)
         (member "org.freedesktop.portal.Desktop"
                 (dbus-list-activatable-names :session)))
    'dbus)
   ((and (eq system-type 'gnu/linux)
         (member 'dbus features)
         (cl-search "termux-fix-shebang"
                    (shell-command-to-string "command -v termux-fix-shebang")))
    'termux)
   ((and (eq system-type 'windows-nt)
         auto-dark-allow-powershell)
    'powershell)
   ((and (eq system-type 'gnu/linux)
         (string-match "-[Mm]icrosoft"
                       (string-trim (shell-command-to-string "uname -r")))
         auto-dark-allow-powershell)
    'powershell)
   ((eq system-type 'windows-nt)
    'winreg)
   (t
    (lwarn 'auto-dark :error "Could not determine a viable theme detection \
mechanism! You can use ‘auto-dark-toggle-appearance’ to manually switch between \
modes."))))