Auto-determine ns-appearance parameter on MacOS
This is experimental. It will adapt the frame titlebar's theme depending on the background of the loaded theme.
This commit is contained in:
parent
0872b29767
commit
4aaeeb509c
1 changed files with 15 additions and 1 deletions
|
@ -51,7 +51,21 @@
|
||||||
exec-path-from-shell-debug doom-debug-mode
|
exec-path-from-shell-debug doom-debug-mode
|
||||||
exec-path-from-shell-variables
|
exec-path-from-shell-variables
|
||||||
(nconc exec-path-from-shell-variables '("LC_CTYPE" "LC_ALL" "LANG")))
|
(nconc exec-path-from-shell-variables '("LC_CTYPE" "LC_ALL" "LANG")))
|
||||||
(exec-path-from-shell-initialize))))
|
(exec-path-from-shell-initialize)))
|
||||||
|
|
||||||
|
(add-to-list 'default-frame-alist '(ns-transparent-titlebar . t))
|
||||||
|
(defun +doom|determine-ns-appearance ()
|
||||||
|
(let ((appearance (cl-destructuring-bind (r g b) (doom-name-to-rgb "#E5E9F0")
|
||||||
|
(if (> (+ (* r 0.2126)
|
||||||
|
(* g 0.7152)
|
||||||
|
(* b 0.0722))
|
||||||
|
0.45)
|
||||||
|
'light
|
||||||
|
'dark))))
|
||||||
|
(setf (alist-get 'ns-appearance default-frame-alist) appearance)
|
||||||
|
(dolist (frame (frame-list))
|
||||||
|
(set-frame-parameter frame 'ns-appearance appearance))))
|
||||||
|
(add-hook 'doom-load-theme-hook #'+doom|determine-ns-appearance))
|
||||||
|
|
||||||
(IS-LINUX
|
(IS-LINUX
|
||||||
(setq x-gtk-use-system-tooltips nil ; native tooltips are ugly!
|
(setq x-gtk-use-system-tooltips nil ; native tooltips are ugly!
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue