Skip to content

josegpt/display-wttr

Repository files navigation

display-wttr.el

https://melpa.org/packages/display-wttr-badge.svg https://stable.melpa.org/packages/display-wttr-badge.svg

Display wttr(weather) in the mode line 🌧️.

Screenshot

Emacs with emoji support >=Emacs 28

./emoji-display-wttr.png Emacs without emoji support <=Emacs 27.2

./no-emoji-display-wttr.png

Installation

MELPA

(require 'package)
(add-to-list 'package-archives
             '("melpa" . "https://melpa.org/packages/") t)

Then use M-x package-install RET display-wttr RET to install the package.

Manual

Download display-wttr.el to your local directory.

Git

git clone https://github.com/josegpt/display-wttr

Curl

curl -s -o display-wttr.el https://raw.githubusercontent.com/josegpt/display-wttr/main/display-wttr.el

Configuration

use-package

(use-package display-wttr
  ;; :custom
  ;; (display-wttr-format "4")
  ;; (display-wttr-locations '(""))
  ;; (display-wttr-interval (* 60 60))
  :config
  (display-wttr-mode))

Manual

Then add the display-wttr.el path to your Emacs load-path and add the following to your Emacs config.

(add-to-list 'load-path "~/emacs/path")

;; If you omit the location name, you will get the report
;; for your current location based on your IP address.
;; (setq display-wttr-locations '("New+York"))
;; (setq display-wttr-locations '("London" "New+York"))
;; (setq display-wttr-locations '("London:New+York"))

;; display-wttr supports any format from one-line output
;; https://github.com/chubin/wttr.in#one-line-output
;; (setq display-wttr-format "4")            ; New York, United States: ☀️ 🌡️+28°F 🌬️→7mph
;; (setq display-wttr-format "%l:+%c+%t")    ; New York, New York, United States: ☀️ +28°F
;; (setq display-wttr-format "%C:+%t+%f+%w") ; Sunny: +28°F +28°F 0mph

;; Interval in which display-wttr.el will be updated.
;; (setq display-wttr-interval (* 60 60))
(display-wttr-mode 1)