Create a gist now

Instantly share code, notes, and snippets.

@trick77 /btc.3m.sh
Last active Sep 24, 2017

What would you like to do?
Bitbar script for Bitcoin/€ pair with currency icon
#!/bin/sh
btcIconBase64='iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3NpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDpmMDk3ZWJmYS0yODA4LTRkNDUtOTYxMC01YTkzNzU4YzY4YmEiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6REMzOTkzNzA0OEZGMTFFNkJCNTNCODBEODQ4N0M2NzgiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6REMzOTkzNkY0OEZGMTFFNkJCNTNCODBEODQ4N0M2NzgiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChNYWNpbnRvc2gpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6NDcyMGI2M2QtZjlmNS00MDlmLWE0NGMtYjExZTc3NTZmOWRjIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOmYwOTdlYmZhLTI4MDgtNGQ0NS05NjEwLTVhOTM3NThjNjhiYSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pokm66sAAAFeSURBVHjatJQ/SwNBEMXvQtRKI6KdFlaWQgqLFFG00EII4geQq2wtkvscdmqhBGxiYaGopBANVkkaSytBsbCIgmITxX9v5R2Mw6ymycDv7nZn9u3dzOyFgW3DYAHMgTEQgltwBqrgIejA8uAEfBl80pf/TyQWi55AGTyCLdBSorFPpKgCL0GGAj3g2njDohbJCuceWAZLYBDkGLMIjg2xbCIyAGrC4T5nXGwyBQpivK6EatQIIk9infWLcVWIvanYKO2pQJsl/wAvfK7Tt8KcSZtOs0+0uR2HWLEJzt3zPmnEj7rLqfFZz6CXHIALFiHZtKLincZPcn05yqi5Vc6vqfmylexXsM8FfeAINMA2x84OdbKt8lf+6HyXtw1f+XVD3oAm2OTh3QUpsGOU/VdDJlZSAVdghpXLcQMtUurk0DreeeLbhkjcld9I6BEbAfNgVvTOHTjnUWnpBd8CDAClYp90pzf2twAAAABJRU5ErkJggg=='
btcLast=$(curl -s "https://api.kraken.com/0/public/Ticker?pair=BTCEUR" | tr -d '{}"[]' | tr ':,' '\n' | grep -A1 "^c$" | tail -1)
printf "%.*f | image=%s\n" 2 "$btcLast" "$btcIconBase64"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment