You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm looking for a way to synchronise the Emacs theme with light/dark/auto mode on macOS. I understand the current method is completely cross-platform, but it would be great to integrate with specific platforms' capabilities.
The text was updated successfully, but these errors were encountered:
@rollcat I just discovered, that emacs-plus is implementing that feature. Might be worth checking it out. I could imagine to integrate it into circadian.el as well
In the meantime, I've been able to hack this together:
(setq system-is-mac (equal"darwin" (symbol-name system-type)))
(defunget-appearance-preferences ()
(if system-is-mac
(do-applescript "tell application \"System Events\" tell appearance preferences if (dark mode) then return \"dark\" else return \"light\" end if end tellend tell")
"dark"))
(defunupdate-theme ()
(let ((ap (get-appearance-preferences)))
(cond
((equal ap "dark") (load-theme preferred-dark-theme))
((equal ap "light") (load-theme preferred-light-theme))
(tnil))))
Of course this does not respond to system theme change events; however I've turned off automatic switching, since in the winter I usually want the dark theme enabled earlier in the day than what the system thinks is appropriate (which brings us full circle to the problem that Circadian is addressing...) And instead I have an Automator shortcut which toggles system appearance, followed by running emacsclient -e '(update-theme)'.
I'm looking for a way to synchronise the Emacs theme with light/dark/auto mode on macOS. I understand the current method is completely cross-platform, but it would be great to integrate with specific platforms' capabilities.
The text was updated successfully, but these errors were encountered: