ecraven / celestial-mode-line

Display lunar phase and sunrise/sunset time in emacs mode line
GNU General Public License v3.0
15 stars 2 forks source link

[[./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.

+BEGIN_SRC elisp

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

+END_SRC

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

+BEGIN_SRC elisp

;; 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))

+END_SRC

Start the timer, to update every few minutes:

+BEGIN_SRC elisp

(celestial-mode-line-start-timer)

+END_SRC

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

+BEGIN_SRC elisp

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

+END_SRC