@@latex:\clearpage@@
This is the manual for darkman.el
version {{{version}}}.
- Homepage: https://darkman.grtcdr.tn
- Repository: https://git.sr.ht/~grtcdr/darkman.el
- Mailing list: https://lists.sr.ht/~grtcdr/pub
- Issue tracker: https://todo.sr.ht/~grtcdr/darkman.el
Copyright (C) 2023 {{{author}}}.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled “GNU Free Documentation License”.
In your init.el
file, define which theme is associated with which
mode. By default, modus-themes
will be used, but we’ll choose the
tango
variants in this example.
(setq darkman-themes '(:light tango :dark tango-dark))
You can also use M-x customize-group darkman RET
to customize the
variable.
darkman
can listen for any signals to change the theme without
requiring you to manually create any scripts. You can enable this
behavior by enabling the minor mode:
(darkman-mode)
You should not call load-theme
in your configuration as
darkman-mode
when enabled will do that for you, even on startup.
M-x darkman-toggle
will toggle the mode of the Darkman service from
within Emacs.
Additionally, you can use the darkman-get
and darkman-set
functions to manually get and set the mode of the service
respectively.
load-theme
is part of the custom
library and it comes with certain
security features that you may regard as inconvenient, but they’re
absolutely necessary to preserve the security of your system. We have
decided to work hand in hand with these pre-existing safety mechanisms
in lieu of implementing our own.
Problems may arise [fn:1] if this package is loaded in a server
setting and too early during the initialization phase, i.e. before
custom-file
, you can prevent this from happening by activating the
mode only when the session has been fully initialized:
(when (daemonp)
(add-hook 'server-after-make-frame-hook #'darkman-mode)
(advice-add 'darkman-mode
:after
(lambda ()
(remove-hook 'server-after-make-frame-hook
#'darkman-mode))))
spacious-padding
significantly improves the aesthetics of our beloved Emacs by
padding the windows and mode line. I’ve personally encountered an issue that
made spacious-padding
behave incorrectly when (1) used in conjuction with
darkman-mode
and (2) when Emacs is started as a daemon, resulting in
window/mode line borders being assigned the wrong color.
I found, through trial and error, that simply delaying the activation of
spacious-padding
when started in daemon mode until the first frame has
appeared solved the problem.
(if (daemonp)
(add-hook 'server-after-make-frame-hook #'spacious-padding-mode)
(spacious-padding-mode))
Emacs does not by default disable the current theme when another one
is loaded, and while this behavior might seem counter-intuitive, we
can always advise darkman-set-theme
(and by extension darkman-toggle
), or
even load-theme
if you prefer, to disable any existing themes first.
(defun disable-existing-themes ()
"Disable any activated themes before loading a new one."
(mapc #'disable-theme custom-enabled-themes))
(advice-add #'darkman-set-theme :before #'disable-existing-themes)
Use your service manager to verify whether the darkman
service is running,
here’s an example using systemd
:
systemctl status dbus
dbus.service - D-Bus System Message Bus Loaded: loaded Active: active (running)
Use your service manager to verify whether the darkman
service is running,
here’s an example using systemd
:
systemctl status --user darkman
darkman.service - Framework for dark-mode and light-mode transitions. Loaded: loaded Active: active (running)
Usually it is, unless you’re building from source, in which case you
can verify whether or not Emacs was built with D-Bus support using
C-h v system-configuration-features RET
which should list DBUS
.
[fn:1] This is known to happen in Doom Emacs.