Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Bitbar script for Monero/€ pair with currency icon
#!/bin/sh
moneroIconBase64='iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAAlwSFlzAAALEwAACxMBAJqcGAAAActpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuNC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIgogICAgICAgICAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyI+CiAgICAgICAgIDx4bXA6Q3JlYXRvclRvb2w+QWRvYmUgSW1hZ2VSZWFkeTwveG1wOkNyZWF0b3JUb29sPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KKS7NPQAAAWhJREFUOBGFk9sqRVEUhpfDlXgGV65cEUoewYt4ARcUIqFcuCCnh5GQYzldCC9AKSSS7fh9a82xWu3IX98e4x9zjjnXmnPtLCvUmKKhD5bhFF4S58Q1cCxU9kTSxMg6fP/DKuPOVdGbNWA2wOYPqKX4RZSofZI7ZxOaodQSWewcTeEj1td9pVxd/DppGyZS7k42VJtj9ynqW2msh5jF7jsaNAk2+tixq7m1aVDO1a9ojpPZ1yTFIu94z8PJc2nMcADWTjRPycQCHqiaASfJPKg49Vjg2ZP0MasawlzDKLSCVzYMg9AOfiMhF88uwORKg2ZB36lJ6iZa89WUG+gvfYIxGACL6rEI2S6xH1rAG1K+rlqADtjT1GucgqvLHTxU/Aj5r/J97+EIbsFmbyAWivyG2iG4qBuV8jG9hWiokfvhVHmrjHsLbZArrkbjCccif8XFvKv4KXvj32W5F/zCzuA1EX9nx0J5zw+DoJOsVTgttgAAAABJRU5ErkJggg=='
xmrLast=$(curl -s "https://api.kraken.com/0/public/Ticker?pair=XMREUR" | tr -d '{}"[]' | tr ':,' '\n' | grep -A1 "^c$" | tail -1)
printf "%.*f | image=%s\n" 2 "$xmrLast" "$moneroIconBase64"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment