Giter VIP home page Giter VIP logo

waybar-crypto's Introduction

waybar-crypto

Tests codecov AUR Version

A Waybar module for displaying cryptocurrency market information, utilising the CoinMarketCap API.

Example Setup

Requirements

  • python >=3.10
  • python-requests

Installation

yay -S waybar-crypto

Note: For the time being, the cryptofont font still needs installing manually

(Or) Clone to the Waybar modules directory

cd ~/.config/waybar/modules
git clone https://github.com/chadsr/waybar-crypto.git crypto && cd crypto/
git submodule update --init --recursive --remote --progress

Install the needed fonts

 # Use ~/.local/share/fonts/TTF (user scope, recommended) or /usr/share/fonts/TTF (system scope)
mkdir -p ~/.local/share/fonts/TTF
ln -s ./.submodules/cryptofont/fonts/cryptofont.ttf ~/.local/share/fonts/TTF

# Rebuild font cache
fc-cache -f

Create Configuration File

Create a configuration file at $XDG_CONFIG_HOME/waybar-crypto/config.ini (This location can be customised with the --config-path flag). The module will not run without first creating this configuration file.

An example can be found in config.ini.example with further options described below in the Configuration section.

Update Waybar Configuration

Found at ~/.config/waybar/config by default

"custom/crypto": {
    "format": "{}",
    "interval": 600,
    "return-type": "json",
    "exec": "waybar-crypto", // change this if you installed manually
    "exec-if": "ping pro-api.coinmarketcap.com -c1"
}

Style the module

Found at ~/.config/waybar/style.css by default

#custom-crypto {
    font-family: cryptofont;
}

Configuration

  • currency: A valid currency code

  • currency_symbol: A corresponding symbol of the currency you wish to display

  • spacer_symbol: A string/character to use as a spacer between tickers. Comment out to disable

  • display: A list of metrics you wish to display for each crypto currency. No spaces. Valid options are:

    • price: current price
    • percent_change_1h: Price change over the past hour
    • percent_change_24h: Price change over the past 24 hours
    • percent_change_7d: Price change over the past week
    • percent_change_30d: Price change over the past thirty days
    • percent_change_60d: Price change over the past sixty days
    • percent_change_90d: Price change over the past ninety days
    • volume_24h: Market volume in your chosen currency, over the past 24 hours
    • volume_change_24h: Market volume change in your chosen currency, over the past 24 hours
  • api_key: CoinmarketCap API key obtained from their API Dashboard

    Alternatively, the CoinMarketCap API key can be set through the environment variable COINMARKETCAP_API_KEY, if you do not wish to save it to the config.ini configuration file.

Adding Cryptocurrencies

For each cryptocurrency you wish to display, add a section as shown in the example file, where the section name is the short cryptocurrency name as found on CoinMarketCap.

Valid options:

  • icon: A character symbol to display next to this cryptocurrency's metrics
  • in_tooltip: Whether to display the data in the tooltip instead of the bar (defaults to false)
  • price_precision The decimal precision at which to display the price value of the cryptocurrency
  • change_precision The decimal precision at which to display the change value(s) of the cryptocurrency
  • volume_precision The decimal precision at which to display the volume value of the cryptocurrency

waybar-crypto's People

Contributors

chadsr avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

joaonunatings

waybar-crypto's Issues

More configuration options?

It's a really nice waybar module, the only crypto ticker for now, thanks a lot!
The only throwback noticed is that it can be really space-consuming, especially if configured for more cryptos.
I was thinking it with the main format with only a crypto (e.g. btc) and for a second one, like eth, using the "format-alt" (or the tooltip for even more).
But I think you have to create every time as many variables as there are crypto added for these customizations, right?
Sorry, I don't know Python for now, can't contribute concretely. :(

Missed dependency AUR

The python-poetry package was not added to the dependencies and the build crashes every time. BTW thanks for the great plugin. <3

How to style?

Thank you so much for your work!

As the title suggests, how do I style this module?

Im not sure what the css selectors are.

Custom formatting options

Would be nice to have an option in the config file to control the string formatting globally, or for each currency pair.

Now that formatting strings are stored in a dict, this should be trivial to implement.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.