Victor3D Info
Search    Contact

Conky config to show current Bitcoin price

The result will be like above: Conky

Create a directory, put a script there and make it executable:


import requests

bitcoin = ""
btc_res = requests.get(bitcoin)
btc_data = btc_res.json()[0]

file = open('/home/victor3d/.config/conky/bitcoin/bitcoin.txt','w')

The script requires python-requests module, to install it on Debian type:

sudo apt-get install python-requests

In my examples, replace the path /home/victor3d/.config/conky/bitcoin/ to your path.

Install the FontAwesome Font.

To your .conkyrc add the following:

${alignc}${font FontAwesome}${font} I T C O I N  ${if_match ${execi 10 awk -F . 'NR==2 {print $1}' /home/victor3d/.config/conky/bitcoin/bitcoin.txt} > 0}${color #00ff00}${font FontAwesome}${font}${execi 10 awk -F . 'NR==2 {print $1}' /home/victor3d/.config/conky/bitcoin/bitcoin.txt}%${color}${else}${color #FF0000}${font FontAwesome}${font}${execi 10 awk -F . 'NR==2 {print $1}' /home/victor3d/.config/conky/bitcoin/bitcoin.txt}%${color}${endif}
${font FontAwesome}${font} ${execi 10 awk -F . 'NR==1 {print substr($1,2)}' /home/victor3d/.config/conky/bitcoin/bitcoin.txt} ${alignr} ${font FontAwesome}${font} ${execi 10 awk -F . 'NR==3 {print $1}' /home/victor3d/.config/conky/bitcoin/bitcoin.txt}

Then, add to crontab to update the prices hourly.

0 * * * * /home/victor3d/.config/conky/bitcoin/