Do you want Emacs to follow your MacOS/Linux/Windows Dark-mode on/off options?
This is it. This program lets Emacs change between 2 user defined (customizable) themes to be automatically changed when Dark Mode set on/off on MacOS/Linux/Windows. Now only supports Gnome on Linux.
By default, themes are wombat and leuven, since these are bundled with Emacs.
Install it from MELPA and add to your .emacs
file:
(require 'auto-dark)
(auto-dark-mode t)
Or simply copy the auto-dark.el file to ~/.emacs.d/auto-dark/auto-dark.el
(or clone this repository there), and then add the following to your .emacs
:
(add-to-list 'load-path "~/.emacs.d/auto-dark/")
(require 'auto-dark)
(auto-dark-mode t)
Or use use-package
to install:
(use-package auto-dark
:config (auto-dark-mode t))
If you use Spacemacs, add (auto-dark)
to the dotspacemacs-additional-packages
list and add the following to dotspacemacs/user-config
:
(use-package auto-dark
:init (spacemacs/defer-until-after-user-config (lambda () (auto-dark-mode t)))
:defer t)
This ensures that auto-dark-mode
is activated only after spacemacs's built-in theme loading logic.
Change your dark-mode settings on MacOS/Linux/Windows and let the magic happens :D
The light/dark themes can be customized using the Emacs customization system. M-x customize-group auto-dark
.
For terminal-based emacs, it is possible to check dark mode status using osascript rather than relying on the built-in Applescript support that GUI Emacs provides. To enable it, customize dark-mode-allow-osascript
and set it to t
.
A demo of this package in action.