Giter Club home page Giter Club logo

circadian.el's Introduction

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


Logo

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 [email protected]:guidoschmidt/circadian.el.git
  2. cd into the git project directory with cd circadian.el and install dependencies via cask
  3. Run test using make test

circadian.el's People

Contributors

guidoschmidt avatar jumper047 avatar berhoel avatar sarg avatar tangxinfa avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.