Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Road to 1.0.0 #35

Merged
merged 40 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
52e336d
Create FUNDING.yml
guidoschmidt Dec 24, 2022
b3bb940
PERF/circadian.el: use memoized sunset & sunrise times (#29)
LemonBreezes Oct 27, 2023
06f3cda
Update issue templates
guidoschmidt Apr 16, 2024
cfe64e0
EDIT: ignore :sunrise and :sunset, if calendar lat/lng settings are m…
guidoschmidt Apr 17, 2024
3bb0a75
FIX: correct testing, filter :sunrise and :sunset if calendar lat/lng…
guidoschmidt Apr 17, 2024
2ffa975
FIX/test.el: re-enable test-circadian-setup-benchmark
guidoschmidt Apr 17, 2024
110161a
FIX/test.el: move timezone test to the end as it changes lat lng
guidoschmidt Apr 17, 2024
3bb73b5
EDIT: check for theme lists to support #16
guidoschmidt Apr 19, 2024
14705d1
FIX/test.el: typo
guidoschmidt Apr 19, 2024
ed24f8d
FIX 28: emacs is freezed at switch (#31)
guidoschmidt Apr 20, 2024
764dbdc
Merge branch 'main' into feature/ignore-sunrise-sunset-on-missing-cal…
guidoschmidt Apr 20, 2024
523cd20
FIX: after merge
guidoschmidt Apr 20, 2024
2c59911
FIX: remove print statements, make sure timer runs only once
guidoschmidt Apr 20, 2024
d1d3aa5
FIX: timer issue + rename circadian-activate-latest-theme to circadia…
guidoschmidt Apr 20, 2024
5203f15
FIX/circadian.el: proper use of new `circadian-activate-and-schedule`
guidoschmidt Apr 21, 2024
36d1ac8
FIX/test.el: adjust tests to use new API
guidoschmidt Apr 21, 2024
ce5e285
DOC/README.md: adjust usage section
guidoschmidt Apr 21, 2024
26d43b2
DOC/README.md
guidoschmidt Apr 21, 2024
3230393
FIX: use format-time-string
guidoschmidt Apr 21, 2024
b5efc25
FIX: improve timer scheduling
guidoschmidt Apr 24, 2024
33e621a
FIX: wrong function in timer
guidoschmidt Apr 25, 2024
9927f4e
FIX: solve recursive timer calls with timer variable + cancel-timer
guidoschmidt Apr 25, 2024
1bc8c4c
FIX/DOC/README.md: proper inner list for random selection from theme …
guidoschmidt Apr 26, 2024
290407c
FIX: endless loop #33 + code cleanup, adjust tests
guidoschmidt Apr 26, 2024
ac9233c
EDIT: introduce circadian-verbose + circadian-stop
guidoschmidt Apr 27, 2024
518bdec
FIX: cleanup, remove circadian-- prefix in favor of single dash prefix
guidoschmidt Apr 27, 2024
92141de
FIX: disable-theme only if requested theme is not part of custom-enab…
guidoschmidt Apr 27, 2024
8dad94e
FIX: check if next run is today or tomorrow
guidoschmidt Apr 27, 2024
12c181d
EDIT/test.el: extend test-circadian-time-comparisons
guidoschmidt Apr 28, 2024
0ec8b12
FIX/circadian.el: ensure a single timer + timer is always set
guidoschmidt Apr 28, 2024
d23d678
EDIT/README.md: hint about `circadian-verbose`
guidoschmidt Apr 29, 2024
87bfd24
FIX #32: proper time zone settings according to Emacs documentation
guidoschmidt Apr 30, 2024
44268e4
EDIT/circadian.el: remove print statement
guidoschmidt Apr 30, 2024
189778a
FIX/test.el
guidoschmidt Apr 30, 2024
ee8d606
UPGRADE/.github: upgrade actions/checkout + actions/cache to version 4
guidoschmidt Apr 30, 2024
85863de
Merge branch 'develop' of https://github.com/guidoschmidt/circadian.e…
guidoschmidt Apr 30, 2024
94ce449
FIX/circadian.el: check for timer nil + enable theme -> set timer to nil
guidoschmidt Apr 30, 2024
433478b
Merge branch 'develop' of https://github.com/guidoschmidt/circadian.e…
guidoschmidt Apr 30, 2024
c6ff7ce
FIX/circadian.el: proper canceling of previous timer
guidoschmidt Apr 30, 2024
e343944
EDIT/circadian.el: update version in comment
guidoschmidt Jun 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# These are supported funding model platforms

github: guidoschmidt
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
31 changes: 31 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: Bug report
about: Create a report to report a bug in circadian.el
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Environment (please complete the following information):**
- OS: [e.g. macOS 14, Windows 11, Ubuntu etc.]
- Emacs: [e.g. emacs-plus 30.0.50]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@ jobs:
strategy:
matrix:
emacs-version:
- 26.3
- 27.2
- 28.2
- 29.3
- snapshot
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: purcell/setup-emacs@master
with:
version: ${{ matrix.emacs-version }}

- uses: actions/cache@v2
- uses: actions/cache@v4
id: cache-cask-packages
with:
path: .cask
key: cache-cask-packages-000

- uses: actions/cache@v2
- uses: actions/cache@v4
id: cache-cask-executable
with:
path: ~/.cask
Expand Down
87 changes: 62 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<h3 align="center">Theme-switching for Emacs based on daytime</h3>
</p>

### Conception
## Conception

Circadian tries to help reducing eye strain that may arise
from difference of your display brightness and the
Expand All @@ -31,9 +31,63 @@ adaption software like:

---

### Example usage
## Usage & Configuration
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
### Configuration with times
To auto-switch a theme on a specific time, use time strings:

```elisp
(use-package circadian
:ensure t
:config
(setq circadian-themes '(("8:00" . wombat)
("19:30" . adwaita)))
(circadian-setup))
```


### 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))
```


### Randomly selection from theme list
Circadian.el can randomly select a theme from a given list, e.g here using [doom-themes](https://github.com/doomemacs/themes) at sunset:

```elisp
(use-package doom-themes)

(use-package circadian
:config
(setq circadian-themes '((:sunrise . doom-gruvbox-light)
(:sunset . (doom-dracula doom-gruvbox))))
(add-hook 'emacs-startup-hook #'circadian-setup)
(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).

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
Expand All @@ -45,33 +99,16 @@ to use `:defer` keyword. Omitting it may lead to broken colors
;; 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](https://www.latlong.net/)):
### Verbose messages
By default circadian will not log any messages. however for development or just
getting more information, one can enable a more verbose message log:

```elisp
;; Install additinal themes from melpa
;; make sure to use :defer keyword
(use-package apropospriate-theme :ensure :defer)
(use-package nord-theme :ensure :defer)
(setq circadian-verbose t)

(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))
```

---
Expand Down Expand Up @@ -107,7 +144,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
Loading