Weather forecasts with sparklines for Emacs, using data from Open-Meteo.
Sparkweather is available in MELPA; M-x package-install RET sparkweather or in your configuration file:
(use-package sparkweather :ensure t :after calendar :config (setq calendar-latitude -41.3 ; Wellington, New Zealand calendar-longitude 174.8))
Run M-x sparkweather to display today's forecast with sparklines.
A small space marks the current time, and coloured blocks highlight your configured windows. Press g to refresh, q to close.
Sparkweather uses the standard Emacs calendar location variables calendar-latitude and calendar-longitude.
Customize all other options via M-x customize-group / sparkweather.
(setq calendar-latitude 47.6 ; Seattle, Washington calendar-longitude -122.3)
Highlight specific time periods in the forecast by customizing sparkweather-time-windows. Each window colours a portion of the sparkline and displays the worst weather for that period:
(setq sparkweather-time-windows '(("Lunch" 12 14) ("Commute" 17 19)))
Windows default to the success face. Specify a different face as the fourth argument:
(setq sparkweather-time-windows '(("Morning run" 6 7) ("School drop-off" 8 9 warning) ("Afternoon pickup" 15 16 warning) ("Evening walk" 18 20 error)))
Define custom faces for time windows with specific colours:
(defface my-cycling-face '((t :foreground "#ff69b4")) "Face for cycling commute window.") (setq sparkweather-time-windows '(("Cycling" 7 9 my-cycling-face) ("Lunch" 12 14)))
Theme-aware faces adapt to light and dark backgrounds:
(defface my-cycling-face '((((background light)) :foreground "#d73a49") (((background dark)) :foreground "#ff6b6b")) "Face for cycling commute, adapts to theme.")
Control whether the footer (timestamp and location) appears in the buffer and whether the window hides it:
;; Don't add footer to buffer at all (setq sparkweather-add-footer nil) ;; Add footer to buffer but size window to hide it (can scroll to see) (setq sparkweather-add-footer t sparkweather-hide-footer t)