百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
W

wttrbar

> 编程语言
开源

自定义模块,用于在 Waybar 中显示天气,使用优秀的 wttr.in

365 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

自定义模块,用于在 Waybar 中显示天气,使用优秀的 wttr.in

wttrbar

a simple but detailed weather indicator for Waybar using wttr.in.

Installation

Compile yourself using cargo build --release, or download the precompiled binary from the releases page.

For Arch Linux, use the AUR package.

For NixOS, use the NixPkg package.

Usage

  • --ampm - display time in AM/PM format
  • --location STRING - pass a specific location to wttr.in
  • --main-indicator - decide which current_conditions key will be shown on waybar. defaults to temp_C
  • --date-format - defaults to %Y-%m-%d, formats the date next to the days. see reference
  • --nerd - use nerd font symbols instead of emojis
  • --hide-conditions - show a shorter descrpition next to each hour, like 7° Mist instead of 7° Mist, Overcast 81%, Sunshine 17%, Frost 15%
  • --fahrenheit - use fahrenheit instead of celsius
  • --mph - use mph instead of km/h for wind speed
  • --custom-indicator STRING - optional expression that will be shown instead of main indicator. current_conditions and nearest_area keys surrounded by {} can be used. For example, "{ICON} {FeelsLikeC} ({areaName})" will be transformed to "text":"️ -4 (Amsterdam)" in the output
  • --lang LANG - set language (currently en, de, pl, tr, fr, ru, zh, be, es, pt, it, ja, uk, sv, da, cs, sk, ga; submit a PR to add yours)
  • --observation-time - show the time the current weather conditions were measured
  • --tabs - use tabs instead of spaces in the forecast rows

e.g. wttrbar --date-format "%m/%d" --location Paris --hide-conditions

Icons

To display the weather icons correctly, you will need to have a font that supports emojis installed. The screenshot uses Noto Emoji, but you can use other fonts too.

Waybar configuration

Assuming wttrbar is in your path, it can be used like:

json
"custom/weather": {
    "format": "{}°",
    "tooltip": true,
    "interval": 3600,
    "exec": "wttrbar",
    "return-type": "json"
},

You can also then creating custom styling based on the current condition:

css
#custom-weather.sunny {
  background-color: yellow;
}

Old version

This code is based on my old Python gist that was used for the same purpose.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Rustswaywaybarwaylandweather

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言