Created
February 10, 2021 16:59
-
-
Save wbollock/ab99084547f18d1aadb0dcdec9d7a837 to your computer and use it in GitHub Desktop.
coinbash ETH and BTC for polybar
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Output