Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

aglet/sparkweather

Repository files navigation

sparkweather

GitHub License MELPA

Weather forecasts with sparklines for Emacs, using data from Open-Meteo.

screenshot

Installation

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

Usage

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.

Configuration

Sparkweather uses the standard Emacs calendar location variables calendar-latitude and calendar-longitude.

Customize all other options via M-x customize-group / sparkweather.

Location

(setq calendar-latitude 47.6 ; Seattle, Washington
 calendar-longitude -122.3)

Time windows

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

Custom faces

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.")

Footer display

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)

License

MIT

About

Sparkline weather forecasts in Emacs

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

AltStyle によって変換されたページ (->オリジナル) /