Lacquer is a util that switches theme/font/font-size and to configure cache, and switch themes automatically. 😋
ps: using it with
which-key
is recommended.
Lacquer is more than a combination of circadian and cycle-themes. It has so many new features, such as, allows users to switch themes and fonts in a more convenient way, to customize each theme, also to define specifically when to switch themes automatically.
- Use both the selector and the shortcut key to switch themes/font.
- Load previous theme/font/font-size after restarting the emacs.
- Each theme can be configured individually.
- Download unused themes automatically with package.el.
- Generate interactive function automatically.
- Automatically change themes depending on a time schedule created by users.
- Distinguish light and dark, and switch themes based on system appearance.
Lacquer is available thorough MELPA repository or download to your load-path.
;; which-key
(use-package which-key
:hook
(after-init . which-key-mode)
:custom
(which-key-popup-type 'minibuffer)
(which-key-sort-order 'which-key-prefix-then-key-order))
;; lacquer
(use-package lacquer
:hook
(after-init . lacquer-auto-mode)
:custom
(lacquer-cache "~/.emacs.d/.lacquer.el")
;; (lacquer-auto-switch-time '("00:01" "00:02" "10:00" "14:00" "16:00" "18:00" "20:00" "22:00")) ;; Switch theme at these times.
(lacquer-auto-switch-time (* 60 30)) ;; Switch theme every half hour.
(lacquer-auto-switch-mode 'random)
(lacquer-appearance-switch t) ;; Switch theme once the system appearance is changed, and distinguish light and dark theme.
(lacquer-theme-list '((monokai-theme monokai both)
(monokai-pro-theme monokai-pro dark)
(dracula-theme dracula dark)
(doom-themes doom-one-light)
(doom-themes doom-vibrant dark)
(doom-themes doom-nord dark)
(leuven-theme leuven light (setq leuven-scale-outline-headlines nil))
(leuven-theme leuven-dark (setq leuven-scale-outline-headlines nil))))
(lacquer-font-list '(Menlo
Roboto\ Mono
Anonymous\ Pro
FantasqueSansMono
FiraMono
Fira\ Code
Operator\ Mono
Inconsolata
Iosevka))
(lacquer-default-font-size 130))
If lacquer-appearance-switch
is enabled, switch theme once the system appearance is changed, and distinguish light and dark theme.
It also works in lacquer-auto-switch-mode
.
(defcustom lacquer-theme-list '((monokai-theme monokai))
"Theme list.
E.g: \='((theme-package-name theme-name tag config)).
Required: theme-package-name theme-name.
Optional: tag(such as `light'/`dark'/`both'), config.
The config is any function about theme setting.
E.g: \='((leuven-theme leuven-dark
(setq leuven-scale-outline-headlines nil)
(message \"i may be a configuration.\"))).
===================== How to distinguish light and dark theme ↓↓↓ =====================
If `lacquer-appearance-switch' is enabled,
the `light'/`dark'/`both' tag is used to define the theme as light or
dark series, or the both series.
E.g: \='((leuven-theme leuven light
(setq leuven-scale-outline-headlines nil)
(message \"i may be a configuration.\"))).
When not set tag, how to distinguish light and dark:
It will depend on theme-name whether included \='light' or \='dark'.
If theme-name does not includes \='light' or \='dark', it will be \='both'.
I recommend labeling all themes of tags.
===================== How to distinguish light and dark theme ====================="
:group 'lacquer
:type '(alist :value-type (group symbol symbol symbol function)))
When emacs started in server mode: (Issues #4)
(after-init . (lambda () (if (daemonp)
(add-hook 'server-after-make-frame-hook #'lacquer-auto-mode)
(lacquer-auto-mode))))
Variable | Default | type | Description |
---|---|---|---|
lacquer-theme-list | ’((monokai-theme monokai)) | list | Theme list. E.g: ‘((theme-package-name theme-name tag config)). |
lacquer-default-theme | ‘monokai | list | Default theme. |
lacquer-cache | ”~/.emacs.d/.lacquer” | string | Path of lacquer cache. |
lacquer-keys-map-index | ’(“1” “2” “3” … “a” “b” “c” … “z 1” “z 2”) | list | Keys map. |
lacquer-font-list | ‘(Menlo Fira\ Code) | list | Font list. E.g: ‘(font-name). |
lacquer-default-font | ‘Menlo | symbol | Default font. |
lacquer-default-font-size | 135 | integer | Default font size. |
lacquer-theme-prefix-key | “C-c T” | string | Trigger theme of prefix key. |
lacquer-font-prefix-key | “C-c F” | string | Trigger font of prefix key. |
lacquer-mode-selector-key | “C-c T M” | string | Mode selector bind key. |
lacquer-font-size-step | 5 | integer | Change font size of step. |
lacquer-auto-switch-mode | ‘orderly | symbol | Mode of switch theme automatically. Currently supports ‘orderly and ‘random. |
lacquer-auto-switch-time | 3600(seconds) | integer/list | When it’s list, switch themes at time of list item every day. And when it’s integer, switch themes for every THIS seconds. |
lacquer-start-auto-switch-key | “C-c T A” | string | Start switch theme automatically bind key. |
lacquer-stop-auto-switch-key | “C-c T P” | string | Stop switch theme automatically bind key. |
lacquer-appearance-switch | nil | boolean | If it’s `no-nil’, switch theme by the system appearance is changed. |
Command | Description |
---|---|
lacquer-current-theme | Print current theme. |
lacquer-current-font | Print current font. |
lacquer-theme-selector | Open theme selector in the minibuffer. |
lacquer-font-selector | Open font selector in the minibuffer. |
lacquer-font-size-increase | Font size increase. |
lacquer-font-size-decrease | Font size decrease. |
lacquer-start-auto-switch | Start switch theme automatically. |
lacquer-stop-auto-switch | Stop switch theme automatically. |
lacquer-mode-selector | Open mode selector in the minibuffer. |
lacquer-start-appearance-switch | Start appearance switch. |
lacquer-stop-appearance-switch | Stop appearance switch. |