Skip to content

Instantly share code, notes, and snippets.

@wbollock
Created February 10, 2021 16:59
Show Gist options
  • Save wbollock/ab99084547f18d1aadb0dcdec9d7a837 to your computer and use it in GitHub Desktop.
Save wbollock/ab99084547f18d1aadb0dcdec9d7a837 to your computer and use it in GitHub Desktop.
coinbash ETH and BTC for polybar
#!/bin/bash
btcprice=$(/home/<your user>/.config/polybar/scripts/coinbash.sh -l btc | grep "BTC" | cut -c 24-32)
echo " \$$btcprice"
# NOTE: credit for coinbash.sh here
# https://github.com/8go/coinbash
# MUST get coinmarketcap API key - free
# link to BTC font-awesome
# https://fontawesome.com/icons/btc
# need to have font-awesome loaded in polybar
# also I'm not sure about the `cut -c 24-32`, not sure if the amount of decimal numbers change ever
#!/bin/bash
ethprice=$(/home/<your user>/.config/polybar/scripts/coinbash.sh -l eth | grep "ETH" | cut -c 25-32)
echo "⧫ \$$ethprice
# for ETH icon i just used regular unicode diamond thing
# polybar config relevant parts
modules-right = eth-price btc-price
# https://github.com/8go/coinbash
# need coinbase API key as global var
[module/btc-price]
type = custom/script
exec = /home/<your user>/.config/polybar/scripts/coinbash-btc.sh
interval = 400
[module/eth-price]
type = custom/script
exec = /home/<your user>/.config/polybar/scripts/coinbash-eth.sh
interval = 400
# interval 400 to hopefully stay within confines of coinmarketcap daily API limit
@wbollock
Copy link
Author

polybar_crypto

Output

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment