Theme-switching for Emacs based on daytime
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
test EDIT/circadian.el + test/circadian.el-test.el: still need to checkout… Oct 24, 2018
.gitignore Initial commit Sep 6, 2017
.travis.yml EDIT/.travis.yml: rermove apt-get for emacs-snapshot Mar 3, 2018
CHANGELOG.md EDIT/CHANGELOG.md: short description for 0.3.2 + 0.3.3 Oct 24, 2018
Cask EDIT/Cask: add version to Cask Oct 22, 2017
LICENSE Initial commit Sep 6, 2017
README.md EDIT/README.md: describe setting up development environment Oct 24, 2018
circadian.el
logo.ai
logo.png EDIT/logo: remove blurred shadows from logo Sep 7, 2017

README.md

MELPA
https://travis-ci.org/guidoschmidt/circadian.el


Logo

circadian

Theme-switching for Emacs based on daytime

Conception

Circadian tries to help reducing eye strain that may arise from difference of your display brightness and the surrounding light.

Inspired by color temperature shifting tools and brightness adaption software like:


Example usage

Switching themes on time of day

Example usage featuring hemera-themes and nyx-theme (with use-package). Make sure to use :defer keyword. Omitting it may lead to broken colors (see issue 9):

;; Install additinal themes from melpa
;; make sure to use :defer keyword
(use-package hemera-theme :ensure :defer)
(use-package nyx-theme :ensure :defer)

(use-package circadian
  :ensure t
  :config
  (setq circadian-themes '(("8:00" . hemera)
                           ("19:30" . nyx)))
  (circadian-setup))
Switching themes on sunrise & sunset

Be sure to set your latitude and longitude (Get them e.g. at latlong.net):

;; Install additinal themes from melpa
;; make sure to use :defer keyword
(use-package apropospriate-theme :ensure :defer)
(use-package nord-theme :ensure :defer)

(use-package circadian
  :ensure t
  :config
  (setq calendar-latitude 49.0)
  (setq calendar-longitude 8.5)
  (setq circadian-themes '((:sunrise . apropospriate-light)
                           (:sunset  . nord)))
  (circadian-setup))

Hooks

circadian provides two hooks:

  • circadian-before-load-theme-hook
  • circadian-after-load-theme-hook

e.g. I like to override any themes cursor color to a very bright color via:

(add-hook 'circadian-after-load-theme-hook
          #'(lambda (theme)
              ;; Line numbers appearance
              (setq linum-format 'linum-format-func)
              ;; Cursor
              (set-default 'cursor-type 'box)
              (set-cursor-color "#F52503")))

Todos & Ideas


Development

Install Emacs cask environment. On macOS you canr use homebrew with: brew install cask.

  1. Clone the circadian.el repository: git clone git@github.com:guidoschmidt/circadian.el.git
  2. cd into the git project directory with cd circadian.el and install dependencies via cask
  3. Run test with ert-runner: cask exec ert-runner