2022-05-31 18:09:33 +00:00
|
|
|
;; -*- lexical-binding: t; -*-
|
|
|
|
|
2024-04-02 21:03:52 +00:00
|
|
|
(defcustom my-light-theme 'doom-solarized-light
|
|
|
|
"My light theme."
|
|
|
|
:type 'symbol
|
|
|
|
:group 'personal
|
|
|
|
:options (custom-available-themes))
|
|
|
|
|
|
|
|
(defcustom my-dark-theme 'doom-solarized-dark
|
|
|
|
"My dark theme."
|
|
|
|
:type 'symbol
|
|
|
|
:group 'personal
|
|
|
|
:options (custom-available-themes))
|
2022-05-31 18:09:33 +00:00
|
|
|
|
|
|
|
(defun mac-appearance () (plist-get (mac-application-state) :appearance))
|
|
|
|
|
|
|
|
(defun dark-theme-enabled? ()
|
|
|
|
(string-equal (mac-appearance)
|
|
|
|
"NSAppearanceNameDarkAqua"))
|
|
|
|
|
|
|
|
(defun set-theme-from-system ()
|
|
|
|
(if (dark-theme-enabled?)
|
|
|
|
(consult-theme my-dark-theme)
|
|
|
|
(consult-theme my-light-theme)))
|
|
|
|
|
|
|
|
(defvar theme-timer-status-cache (mac-appearance))
|
|
|
|
(defun theme-timer-fn ()
|
|
|
|
(let ((appearance (mac-appearance)))
|
|
|
|
(when (not (string-equal appearance theme-timer-status-cache))
|
|
|
|
(set-theme-from-system)
|
|
|
|
(setq theme-timer-status-cache appearance))))
|
|
|
|
(defun theme-timer-hook ()
|
|
|
|
(run-at-time "2 sec" 2 #'theme-timer-fn))
|
|
|
|
|
|
|
|
(add-hook 'after-init-hook #'theme-timer-hook)
|
|
|
|
|
2024-03-26 18:21:37 +00:00
|
|
|
(unbind-key "C-<tab>" global-map)
|
2024-03-27 18:51:49 +00:00
|
|
|
(unbind-key "C-S-<tab>" global-map)
|
2024-03-26 18:21:37 +00:00
|
|
|
|
2022-05-31 18:09:33 +00:00
|
|
|
(provide 'init-mac)
|