Skip to content

Display lunar phase and sunrise/sunset time in emacs mode line

License

Notifications You must be signed in to change notification settings

ecraven/celestial-mode-line

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 

Repository files navigation

celestial-mode-line

./celestial-mode-line.png

Screenshot: 5 days to full moon, sunset at 16:12.

Quick start

Install celestial-mode-line from melpa.

Set your coordinates, so that sunrise/sunset can be calculated correctly.

(setq calendar-longitude 25.5)
(setq calendar-latitude 17.5)
(setq calendar-location-name "Some place")

Add celestial-mode-line-string to the mode line, for example:

;; add to end of global-mode-string
(if (null global-mode-string)
    (setq global-mode-string '("" celestial-mode-line-string))
  (add-to-list 'global-mode-string 'celestial-mode-line-string t))

Start the timer, to update every few minutes:

(celestial-mode-line-start-timer)

If you don’t like the default icons, just set alternatives, any unicode characters should work:

(defvar celestial-mode-line-phase-representation-alist '((0 . "") (1 . "") (2 . "") (3 . "")))
(defvar celestial-mode-line-sunrise-sunset-alist '((sunrise . "☀↑") (sunset . "☀↓")))

About

Display lunar phase and sunrise/sunset time in emacs mode line

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages