Skip to content

Commit

Permalink
DOC/README.md: adjust usage section
Browse files Browse the repository at this point in the history
  • Loading branch information
guidoschmidt committed Apr 21, 2024
1 parent 36d1ac8 commit ce5e285
Showing 1 changed file with 39 additions and 27 deletions.
66 changes: 39 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,47 +31,59 @@ adaption software like:

---

### Example usage
### Usage
Install circadian.el with
[use-package](https://www.gnu.org/software/emacs/manual/html_mono/use-package.html)
or [straight.el](https://github.com/radian-software/straight.el)

##### Switching themes on time of day

Example usage featuring [hemera-themes](https://github.com/GuidoSchmidt/emacs-hemera-theme)
and [nyx-theme](https://github.com/GuidoSchmidt/emacs-nyx-theme) (with use-package). Make sure
to use `:defer` keyword. Omitting it may lead to broken colors
(see [issue 9](https://github.com/guidoschmidt/circadian.el/issues/9)):
##### Configuration with times
To auto-switch a theme on a specific time, use time strings:

```elisp
;; 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)))
(setq circadian-themes '(("8:00" . wombat)
("19:30" . adwaita)))
(circadian-setup))
```

##### Switching themes on sunrise & sunset
##### Configuration with `:sunrise` and `:sunset`
To auto-switch a theme based on your current locations sunrise and sunset times:

1. Make sure to set your latitude and longitude (Get them e.g. at
[latlong.net](https://www.latlong.net/)):

```elisp
(setq calendar-latitude 40.712776)
(setq calendar-longitude -74.005974)
```
2. Configure `circadian-themes` using the `:sunset` and `:sunset`
```elisp
(use-package circadian
:ensure t
:config
(setq circadian-themes '((:sunrise . adwaita)
(:sunset . wombat)))
(circadian-setup))
```

##### Use with custom themes
To use custom themes, install them from MELPA using
e.g. [use-package](https://www.gnu.org/software/emacs/manual/html_mono/use-package.html)
or [straight.el](https://github.com/radian-software/straight.el).

Be sure to set your latitude and longitude (Get them e.g. at [latlong.net](https://www.latlong.net/)):
Example usage featuring [hemera-themes](https://github.com/GuidoSchmidt/emacs-hemera-theme)
and [nyx-theme](https://github.com/GuidoSchmidt/emacs-nyx-theme) (with use-package). Make sure
to use `:defer` keyword. Omitting it may lead to broken colors
(see [issue 9](https://github.com/guidoschmidt/circadian.el/issues/9)):

```elisp
;; 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))
(use-package hemera-theme :ensure :defer)
(use-package nyx-theme :ensure :defer)
```

---
Expand Down Expand Up @@ -107,7 +119,7 @@ e.g. I like to override any themes cursor color to a very bright color via:

---

### Development
### Development & Testing

Install Emacs [cask](https://github.com/cask/cask) environment. On macOS you
canr use [homebrew](https://brew.sh/) with: `brew install cask`.
Expand Down

0 comments on commit ce5e285

Please sign in to comment.