-
Notifications
You must be signed in to change notification settings - Fork 87
PluginWeather
Display current weather conditions from wttr.in with customizable location, units, and format.
☀️ 15°C # Dynamic icon mode (default)
15°C # Static icon mode
☀️ 15°C Clear # With condition text
🌧️ 8°C ↗5km/h # Temperature with wind
❄️ -5°C 65% # Negative temperature with humidity
| Property | Value |
|---|---|
| Platform | macOS, Linux, BSD, WSL |
| Dependencies | curl |
| Content Type | dynamic |
| Presence | conditional |
# macOS (Homebrew)
brew install curl
# Linux (usually pre-installed)
sudo apt install curl # Debian/Ubuntu
sudo dnf install curl # Fedora
sudo pacman -S curl # Arch# Enable plugin (auto-detects location)
set -g @powerkit_plugins "weather"# Enable plugin
set -g @powerkit_plugins "weather"
# Location (empty for auto-detect, or city name)
set -g @powerkit_plugin_weather_location ""
# Units: m (metric/Celsius), u (US/Fahrenheit), M (SI/Kelvin)
set -g @powerkit_plugin_weather_units "m"
# Format string (%t=temp, %c=condition icon, %C=condition text, %w=wind, %h=humidity)
set -g @powerkit_plugin_weather_format "%t"
# Language code (optional)
set -g @powerkit_plugin_weather_language ""
# Hide + sign on positive temperatures (default: true)
set -g @powerkit_plugin_weather_hide_plus_sign "true"
# Icon (used when icon_mode is static)
set -g @powerkit_plugin_weather_icon ""
# Icon mode: static (use icon option) or dynamic (use weather condition symbol from API)
set -g @powerkit_plugin_weather_icon_mode "dynamic"
# Cache duration (seconds) - weather updates slowly
set -g @powerkit_plugin_weather_cache_ttl "1800"
# Only show on threshold (not applicable for weather)
set -g @powerkit_plugin_weather_show_only_on_threshold "false"| Option | Type | Default | Description |
|---|---|---|---|
@powerkit_plugin_weather_location |
string | `` | Location (city name, empty for auto-detect) |
@powerkit_plugin_weather_units |
string | m |
Units: m (metric/°C), u (US/°F), M (SI/K) |
@powerkit_plugin_weather_format |
string | %t |
Format string (see Format Codes below) |
@powerkit_plugin_weather_language |
string | `` | Language code (pt, es, fr, de, etc.) |
@powerkit_plugin_weather_hide_plus_sign |
bool | true |
Hide + sign on positive temperatures |
@powerkit_plugin_weather_icon |
icon | |
Plugin icon (used when icon_mode is static) |
@powerkit_plugin_weather_icon_mode |
string | dynamic |
Icon mode: static or dynamic (API symbol) |
@powerkit_plugin_weather_cache_ttl |
number | 1800 |
Cache duration in seconds (30 min) |
@powerkit_plugin_weather_show_only_on_threshold |
bool | false |
Only show when threshold exceeded (N/A) |
| Mode | Description | Example |
|---|---|---|
dynamic |
Uses weather condition symbol from API (☀️, 🌧️, ❄️, etc.) | ☀️ 15°C |
static |
Uses the configured icon option | 15°C |
| State | Condition | Visibility |
|---|---|---|
active |
Weather data fetched successfully | Visible |
inactive |
Cannot fetch weather (network/API error) | Hidden |
| Level | Condition | Color |
|---|---|---|
ok |
Weather data available | Green |
| Context | Description |
|---|---|
available |
Weather data successfully retrieved |
unavailable |
Network error or API unavailable |
wttr.in supports various format codes for customizing weather display:
| Code | Description | Example |
|---|---|---|
%t |
Temperature | 15°C |
%c |
Weather condition icon |
☀️ or 🌧️
|
%C |
Weather condition text |
Clear, Cloudy
|
%w |
Wind speed and direction | ↗5km/h |
%h |
Humidity | 65% |
%p |
Precipitation (mm/24h) | 0.1mm |
%P |
Pressure (hPa) | 1015hPa |
%u |
UV index | 3 |
%m |
Moon phase | 🌓 |
# Temperature only
set -g @powerkit_plugin_weather_format "%t"
# Output: 15°C
# Temperature with condition
set -g @powerkit_plugin_weather_format "%c %t"
# Output: ☀️ 15°C
# Full weather info
set -g @powerkit_plugin_weather_format "%c %t %C"
# Output: ☀️ 15°C Clear
# Temperature with wind and humidity
set -g @powerkit_plugin_weather_format "%t %w %h"
# Output: 15°C ↗5km/h 65%| Unit | Code | Temperature | Wind | Precipitation |
|---|---|---|---|---|
| Metric | m |
Celsius (°C) | km/h | mm |
| US/Imperial | u |
Fahrenheit (°F) | mph | in |
| SI | M |
Kelvin (K) | m/s | mm |
wttr.in supports multiple languages for condition text:
| Language | Code | Example |
|---|---|---|
| English | `` | Clear |
| Portuguese | pt |
Limpo |
| Spanish | es |
Despejado |
| French | fr |
Dégagé |
| German | de |
Klar |
| Russian | ru |
Ясно |
| Italian | it |
Sereno |
| Chinese | zh |
晴朗 |
For full list, see wttr.in language support.
set -g @powerkit_plugins "weather"Output: ☀️ 15°C
set -g @powerkit_plugins "weather"
set -g @powerkit_plugin_weather_location "London"Output: ☀️ 12°C
set -g @powerkit_plugins "weather"
set -g @powerkit_plugin_weather_units "u"Output: ☀️ 59°F
set -g @powerkit_plugins "weather"
set -g @powerkit_plugin_weather_icon_mode "static"
set -g @powerkit_plugin_weather_icon ""Output: 15°C
set -g @powerkit_plugins "weather"
set -g @powerkit_plugin_weather_hide_plus_sign "false"Output: ☀️ +15°C
set -g @powerkit_plugins "weather"
set -g @powerkit_plugin_weather_format "%t %C"Output: ☀️ 15°C Clear
set -g @powerkit_plugins "weather"
set -g @powerkit_plugin_weather_format "%t %C"Output: ☀️ 15°C Clear
set -g @powerkit_plugins "weather"
set -g @powerkit_plugin_weather_format "%t %w %h"Output: ☀️ 15°C ↗5km/h 65%
set -g @powerkit_plugins "weather"
set -g @powerkit_plugin_weather_format "%t %C"
set -g @powerkit_plugin_weather_language "pt"Output: ☀️ 15°C Limpo
set -g @powerkit_plugins "weather"
set -g @powerkit_plugin_weather_cache_ttl "900" # 15 minutesThe location option accepts various formats:
| Format | Example |
|---|---|
| City name | London |
| City, Country | Paris,France |
| Airport code | LAX |
| Coordinates | ~37.7749,-122.4194 |
| Domain/IP | @github.com |
-
Check network connectivity:
curl -I https://wttr.in
-
Verify curl is installed:
which curl curl --version
-
Test wttr.in manually:
curl "https://wttr.in?format=%t"
Auto-detection uses your IP address. To force a specific location:
set -g @powerkit_plugin_weather_location "YourCity"Weather API can be slow. Increase cache duration:
set -g @powerkit_plugin_weather_cache_ttl "3600" # 1 hourEnsure your terminal supports Unicode and has proper font:
- Use a Nerd Font or font with emoji support
- Check terminal encoding is UTF-8
wttr.in has rate limits. If you hit limits:
- Increase
cache_ttlto reduce requests - Avoid refreshing tmux status too frequently
Connection timeout is 3 seconds, max time is 6 seconds. If your connection is slow:
- Increase cache TTL to reduce API calls
- Check your internet connection stability
This plugin uses the wttr.in weather service:
- Free and open source
- No API key required
- Data from multiple weather services
- Supports worldwide locations
- PluginDatetime - Date and time display
- PluginTimezones - Multiple timezone display
- PluginExternalIp - Public IP address