Skip to content

timtorChen/tmux-weather

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

11 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŒž๐ŸŒ› Tmux-weather

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: ้ƒญ้‡‡ๆฝ” - ๅˆๅœ“ไบ†็š„ๆœˆไบฎ

  1. The plugin script use curl, jq, awk, and tpm make sure you have these tools.

  2. Add the following line to ~/.tmux.conf.

set -g @plugin 'timtorchen/tmux-weather'
  1. Press Prefix + I to fetch the plugin.

Configration

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.

  1. Regist two services and get the API tokens
  2. 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"

Usage

Open ~/.tmux.conf file, and add #{weather} tag anywhere you want to show the weather, for example:

set-option -g status-right "#{weather}"

Customization

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"

References

Releases

No releases published

Packages

No packages published

Languages