Skip to content
Emacs light/dark theme toggler
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE
README.md Friendlify Contribution section of readme Apr 22, 2018
demo.gif
heaven-and-hell.el
logo.jpg (#1) - add logo of appropriate size Apr 11, 2018

README.md

Heaven and Hell Emacs Emacs Emacs MELPA MELPA Stable

Logo

Heaven and Hell - emacs package for easy toggling of light/dark color themes.

TLDR:

Demo

Why?

I constantly switch light and dark theme. When it's sunny outside, or I work in a very light room - I use the light theme. Otherwise, I prefer dark one. So I wrote a bunch of helpers which helped me with this and one day I decided to make a package out of it. Hope it'll be useful to anybody else. Cheers!

Features

  • Define your favorite light and dark themes
  • Choose which one to run by default
  • Switch between them with a single keypress
  • Easily roll back to default emacs theme in case of messed faces

Installation

heaven-and-hell is available in Melpa.

With use-package

With use-package (including example config):

(use-package heaven-and-hell
  :ensure t
  :init
  (setq heaven-and-hell-theme-type 'dark) ;; Omit to use light by default
  (setq heaven-and-hell-themes
        '((light . tsdh-light)
          (dark . tsdh-dark))) ;; Themes can be the list: (dark . (tsdh-dark wombat))
  :hook (after-init . heaven-and-hell-init-hook)
  :bind (("C-c <f6>" . heaven-and-hell-load-default-theme)
         ("<f6>" . heaven-and-hell-toggle-theme)))

With straight.el

(straight-use-package 'heaven-and-hell)

Manually

First clone the repo:

git clone https://github.com/valignatev/heaven-and-hell.git your/site/elisp/path

Then add this in your init.el:

(require 'heaven-and-hell "your/site/elisp/path/heaven-and-hell/heaven-and-hell.el")

Example configuration

For use-package configuration look above in installation section

;; Default is 'light
(setq heaven-and-hell-theme-type 'dark)

;; Set preferred light and dark themes
;; default light is emacs default theme, default dark is wombat
;; Themes can be the list: (dark . (tsdh-dark tango-dark))
(setq heaven-and-hell-themes
      '((light . tsdh-light)
        (dark . tsdh-dark)))

;; Add init-hook so heaven-and-hell can load your theme
(add-hook 'after-init-hook 'heaven-and-hell-init-hook)

;; Set keys to toggle theme and return to default emacs theme
(global-set-key (kbd "C-c <f6>") 'heaven-and-hell-load-default-theme)
(global-set-key (kbd "<f6>") 'heaven-and-hell-toggle-theme)

Contribution

Have trouble with installation? Found a bug? Want a new feature? Feel free to open an issue!

Want to fix a bug or add something new yourself? Feel free to submit pull request!

Also, don't hesitate to share it anywhere in the Internet :)

License

MIT

You can’t perform that action at this time.