Tmux-weather is a weather plugin for tmux. In the morning, it will simply show the weather condition. After sunset, the world becoming darker, but staying calm, if in a good weather condition, the moon is always be with you, and also on your status bar.
Motivation: ้ญ้ๆฝ - ๅๅไบ็ๆไบฎ
Install with tmux plugin manager - tpm
-
The plugin script use
curl
,jq
,awk
, and tpm make sure you have these tools. -
Add the following line to
~/.tmux.conf
.
set -g @plugin 'timtorchen/tmux-weather'
- Press
Prefix + I
to fetch the plugin.
This plugin use ipinfo.io and OpenWeatherMap two services to get the weather by your ip address, if you do not configure them, you will get ๐ lack-of-token
.
- Regist two services and get the API tokens
- After getting two tokens, put them into your startup file as enviromnent variable. If you are using bash as the default shell we suggest
~/.bashrc
, for zsh user~/.zshrc
is suggested.
export IPINFO_TOKEN="your-ipinfo-token"
export OWM_TOKEN="your-OpenWeatherMap-token"
Open ~/.tmux.conf
file, and add #{weather}
tag anywhere you want to show the weather, for example:
set-option -g status-right "#{weather}"
There are few customization options: update interval, location and temperature units. Add the options in your ~/.tmux.conf
if the default options do not meet your need.
# update interval is 15 minutes by default
set-option -g @tmux-weather-interval 15
# use ip to get location by default
set-option -g @tmux-weather-location "Taipei"
# set "c" for Celsius, and "f" for Fahrenheit.
# default units is "c"
set-option -g @tmux-weather-units "c"