this post was submitted on 16 Oct 2023
1 points (66.7% liked)

Emacs

313 readers
3 users here now

A community for the timeless and infinitely powerful editor. Want to see what Emacs is capable of?!

Get Emacs

Rules

  1. Posts should be emacs related
  2. Be kind please
  3. Yes, we already know: Google results for "emacs" and "vi" link to each other. We good.

Emacs Resources

Emacs Tutorials

Useful Emacs configuration files and distributions

Quick pain-saver tip

founded 1 year ago
MODERATORS
 

Hey everybody, first time poster here.

I've been using Emacs for a while now, but just recently starting toying with configs, experiencing new packages, learning some elisp so I can customize my emacs experience and overall making it my own.

A while back I noticed I needed some sort of dark mode functionality to change the theme to a darker one when there is less sunlight. After searching for some packages, I found none that really suited me.

So I decided to write my own: https://github.com/pedroangelo/theme-rotation.el

Check it out and tell me what you guys think. I've also included a sort of related work section in the README that discusses similar packages, and why I didn't found them to my taste.

PS: I wrote this package for my personal use. But if more people find it useful, I'd be quite satisfied with myself.

Also, do you think I should work towards getting it published in MELPA? I don't mind the work if it something that potentially many people might enjoy using.

top 3 comments
sorted by: hot top controversial new old
[–] ajgrf@alien.top 1 points 1 year ago

Looks good! Although I went looking for a comparison to circadian (which is what I use) in the README and didn't see it. Were you aware of it before writing your own package?

[–] LionyxML@alien.top 1 points 1 year ago

Not exactly what you asked, but take a look at https://github.com/LionyxML/auto-dark-emacs

It follows your system settings, only for dark/light modes. Available on melpa and works with Linux, macOS, Windows and Android(via termux).

[–] abbreviatedman@alien.top 1 points 1 year ago

Reviewed the code, great job on your first package—wouldn't know it was your first if you hadn't said so! I think you should definitely get it on MELPA.

If you wanted a next step for it, you could consider giving users not just the option of set times, but:

  • tying it into the OS dark/light schedule
  • or tying into Emacs' solar functions to get their local sunrise/sunset times
  • or making an API call to get local sunrise/sunset times.

You could also give them an option to provide an offset to those times... maybe they want light theme 30 minutes after the sun rises and dark theme 45 minutes before the sun sets, for example.

I did some thinking on this because I wanted to write a similar package at some point, before realizing I actually didn't want to switch themes at all. : )

No matter where you go with this, congrats on your first package. Well done!