Doppler Radar in Emacs
Doppler Radar In Emacs
It’s raining today where I live, and I was reminded of a certain Luke Smith video. In the video, Smith uses mpv + dmenu to create a keybinding to view doppler radar.
It’s a little dated as the links for the radar stations have changed, and it’s not using the text editor of the future, Emacs! So I decided as a challenge to set this up in emacs.
I’ve never even written a custom function in my init.el before, so this was a first time for me.
The gifs for so called low res doppler radar are located here: https://radar.weather.gov/ridge/standard/
You will need to locate your local weather station by its callsign, for example Los Angeles is KVTX.
Setting up the Elisp Function
In my init.el I have this
(defun radar ()
(interactive)
(browse-url-emacs
"https://radar.weather.gov/ridge/standard/KVTX_loop.gif")
)
Then to see a doppler radar at any time for your region, simply run
M-x radar RET!
This will pop it up in Emacs image mode, so unfortunately you’ll need
to press RET to start the gif. It also wont loop by default, you’ll
need to set the variable image-animate-loop to a non-nil value for
gifs to loop.
To get the image to animate by default and loop, I set this up in my init.el
(setq image-animate-loop t)
(add-hook 'image-mode-hook #'image-toggle-animation)
Conclusion
After running the command, you should see something like this:
I thought this was a neat little project as I’ve not touched emacs lisp very much at all before. Hopefully you found it interesting as well. If you have issues with my code or formatting or suggestions, please mail me!