aboutsummaryrefslogtreecommitdiff
path: root/modules/weather-config.el
blob: 93b0a61482e613b0a15182b3fae197006925fee1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
;;; weather-config.el ---  -*- lexical-binding: t; coding: utf-8; -*-
;; author: Craig Jennings <c@cjennings.net>
;;; Commentary:
;;
;; Layer: 4 (Optional).
;; Category: O/D/P.
;; Load shape: eager.
;; Eager reason: none; optional weather command, a command-loaded deferral
;;   candidate. Degrades cleanly when wttrin is absent.
;; Top-level side effects: package configuration via use-package.
;; Runtime requires: none (configures packages via use-package).
;; Direct test load: yes.
;;
;; Call M-W to open wttrin with your preferred location list immediately.
;; Adjust the city list by editing `wttrin-default-locations` or answering wttrin prompts when asked.
;; Forecasts arrive in an Emacs buffer, so you can stay keyboard-only while checking weather.
;;
;;; Code:

;; ----------------------------------- Wttrin ----------------------------------

(use-package wttrin
  :vc (:url "git@cjennings.net:emacs-wttrin.git"
       :branch "main"
       :rev :newest)
  ;; :load-path "~/code/emacs-wttrin"  ;; uncomment + comment :vc above for local dev
  :demand t  ;; REQUIRED: mode-line must start at Emacs startup
  :preface
  ;; Change this to t to enable debug logging
  ;; (setq wttrin-debug t)
  :bind
  ("M-S-w" . wttrin)  ;; was M-W, overrides kill-ring-save
  :config
  (setopt wttrin-unit-system "u")
  (setopt wttrin-favorite-location "New Orleans, LA")
  (setopt wttrin-mode-line-refresh-interval (* 30 60)) ;; thirty minutes
  (setq wttrin-default-locations '(
                                   "New Orleans, LA"
                                   "Berkeley, CA"
                                   "Huntington Beach, CA"
                                   "Bury St Edmunds, UK"
                                   "New York, NY"
                                   "Littlestown, PA"
                                   "Soufrière, St Lucia"
                                   "London, GB"
                                   "Naples, IT"
                                   "Athens, GR"
                                   "Kyiv, UA"
                                   ))
  (wttrin-mode-line-mode 1))

(provide 'weather-config)
;;; weather-config.el ends here.