A customizable Waybar module written in Go that displays real-time prices for stocks, cryptocurrencies and indices.
Supports price rotation, percent change indicators, custom colors, and YAML configuration — no external Python scripts or dependencies required.
- Display stock, crypto, or index prices (e.g.
BTC-USD(orbitcoinlike CoinGecko's naming),AAPL,SPY,^GSPC), and Argentinian Dólar prices (dolar-oficial,dolar-blue,dolar-cripto, etc.). - Shows price + percent change + up/down icons for each asset.
- Configurable via
config.yml.- Supports color customization
- Assets
- Refresh & rotation interval!
- Timeframe for each stock! (see Timeframe (per-asset))
- Fast & lightweight (native Go binary, no runtime needed)
- Includes CLI flags like
--helpand--config - Works perfectly with Waybar (Hyprland / Sway / niri / dwl)
- Go 1.20+ (or the version configured in
go.mod) - Internet access to query Yahoo Finance and CoinGecko
- Clone the repository:
git clone https://github.com/bautitobal/waybar-stocks.git
cd waybar-stocks- Build:
go build -o waybar-stocks(Opcional) Move it to PATH:
sudo mv waybar-stocks ~/.local/bin/Create or edit the file config.yml in the project folder or any custom path.
refresh_interval: 60 # seconds between API updates
rotation_interval: 5 # seconds to display each asset
format: "{symbol} {price} ({change}%{icon})"
colors:
up: "#00FF00" # price increasing
down: "#FF5555" # price decreasing
neutral: "#FFFFFF" # no change
assets:
- symbol: BTC-USD
name: BTC
timeframe: 1D
- symbol: AAPL
name: AAPL
timeframe: 1W
- symbol: SPY
name: S&P500
timeframe: 1M
- symbol: dolar-oficial
name: DÓLAR OFICIAL
timeframe: 1D
- symbol: dolar-cripto
name: DÓLAR CRIPTO
timeframe: 1DYou can optionally set a timeframe per asset to control which period the percent change is computed for. If omitted, the default is daily (1D). Examples:
15m— 15 minutes1HorH— 1 hour1DorD— 1 day (default)3D— 3 days1WorW— 1 week1M— 1 month (approximated as 30 days)1YorY— 1 year (approximated as 365 days)
Notes:
- For stocks the fetcher will prefer Yahoo's session metadata for daily change, or request Yahoo chart data for custom timeframes and compute the percent between "now" and "timeframe ago".
- For cryptocurrencies the fetcher uses CoinGecko's 24h percent by default; for custom timeframes it queries CoinGecko's market_chart and computes the percent accordingly.
- For
dolar-*symbols the app fetches the latestventa(orcompra) from DolarApi and computes change relative to the last saved value (persisted in the cache). If you need percent vs a fixed period (e.g. 24h), the app can be extended to keep a longer history or use historical endpoints.
You can include the {timeframe} token in your format string to show the timeframe explicitly. If {timeframe} is not present, the timeframe will be appended to the symbol automatically when set.
In your ~/.config/waybar/config.jsonc, add:
Then reload waybar.
waybar-stocks --helpPull requests are welcome! Feel free to open an issue for feature requests or bugs.
This project is available under the MIT License — see the LICENSE file for details.
If you have any questions or need help, feel free to open an issue or contact the maintainers.
Feel free to donate! (If you can afford and you want of course).